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
34 lines
1023 B
JavaScript
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'
|
|
}]
|
|
}
|
|
};
|