p5.js-web-editor/webpack.config.examples.js

93 lines
1.7 KiB
JavaScript
Raw Normal View History

const path = require('path');
const nodeExternals = require('webpack-node-externals');
module.exports = [{
entry: path.resolve(__dirname, 'server/scripts/fetch-examples.js'),
output: {
path: __dirname + '/dist/',
filename: 'fetch-examples.bundle.js'
},
target: 'node',
externals: [nodeExternals()],
resolve: {
extensions: ['*', '.js', '.jsx'],
modules: [
'client',
'node_modules',
],
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: [
'react',
'env',
'stage-0',
],
plugins: [
[
'babel-plugin-webpack-loaders', {
'config': './webpack.config.babel.js',
"verbose": false
}
]
]
},
}
],
},
},
{
entry: path.resolve(__dirname, 'server/scripts/fetch-examples-gg.js'),
output: {
path: __dirname + '/dist/',
filename: 'fetch-examples-gg.bundle.js'
},
target: 'node',
externals: [nodeExternals()],
resolve: {
extensions: ['*', '.js', '.jsx'],
modules: [
'client',
'node_modules',
],
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: [
'react',
'env',
'stage-0',
],
plugins: [
[
'babel-plugin-webpack-loaders', {
'config': './webpack.config.babel.js',
"verbose": false
}
]
]
},
}
],
},
}];