Files
scratch-gui/webpack.config.js
T
Ray Schamp 882a6107ba Use .js for everything
Thanks to babel-loader and babel-eslint, we can use the same linting everywhere.  This makes our imports easier since we don't need to think about the extension.

Also export things more succinctly in src/index.js
2016-09-15 12:20:00 -04:00

34 lines
1023 B
JavaScript

var path = require('path');
module.exports = {
entry: {
gui: './src/index.js'
},
output: {
library: 'ScratchGUI',
path: __dirname,
filename: '[name].js'
},
module: {
loaders: [{
test: /\.js$/,
loader: 'babel-loader',
include: path.resolve(__dirname, 'src'),
query: {
presets: ['es2015', 'react']
}
}, {
test: /\.json$/,
loader: 'json-loader'
}, {
test: require.resolve('scratch-blocks/blockly_compressed_vertical'),
loader: 'exports?Blockly'
}, {
test: require.resolve('scratch-blocks/blocks_compressed'),
loader: 'imports?Blockly=scratch-blocks/blockly_compressed_vertical!exports?Blockly'
}, {
test: require.resolve('scratch-blocks/blocks_compressed_vertical'),
loader: 'imports?Blockly=scratch-blocks/blocks_compressed!exports?Blockly'
}]
}
};