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

102 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: path.resolve(__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',
options: {
babelrc: true
}
}
],
},
},
{
entry: path.resolve(__dirname, '../server/scripts/fetch-examples-gg.js'),
output: {
path: path.resolve(__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',
options: {
babelrc: true
}
}
],
},
},
{
entry: path.resolve(__dirname, '../server/scripts/fetch-examples-ml5.js'),
output: {
path: path.resolve(__dirname, '../dist/'),
filename: 'fetch-examples-ml5.bundle.js'
},
target: 'node',
externals: [nodeExternals()],
resolve: {
extensions: ['*', '.js', '.jsx'],
modules: [
'client',
'node_modules',
],
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
babelrc: true
}
}
],
},
}];