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

65 lines
1.3 KiB
JavaScript
Raw Normal View History

2016-05-03 06:09:16 +02:00
var webpack = require('webpack');
require('dotenv').config();
2016-05-03 06:09:16 +02:00
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: {
app: ['babel-polyfill',
'webpack-hot-middleware/client',
'./client/index.jsx',
],
vendor: [
'react',
'react-dom'
]
},
2016-05-03 06:09:16 +02:00
output: {
path: __dirname + '/dist/',
filename: 'app.js',
2016-05-03 06:09:16 +02:00
publicPath: '/dist/'
},
resolve: {
extensions: ['', '.js', '.jsx'],
modules: [
'client',
'node_modules',
]
2016-05-03 06:09:16 +02:00
},
plugins: [
2016-06-23 00:36:04 +02:00
new webpack.HotModuleReplacementPlugin(),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: Infinity,
filename: 'vendor.js',
}),
2016-06-23 00:36:04 +02:00
new webpack.DefinePlugin({
'process.env': {
CLIENT: JSON.stringify(true),
'NODE_ENV': JSON.stringify('development'),
'S3_BUCKET': '"' + process.env.S3_BUCKET + '"'
2016-06-23 00:36:04 +02:00
}
})
2016-05-03 06:09:16 +02:00
],
module: {
loaders: [
{
2016-06-27 23:40:16 +02:00
test: /\.jsx?$/,
2016-05-03 06:09:16 +02:00
exclude: [/node_modules/, /.+\.config.js/],
loaders: ['babel', 'eslint-loader']
2016-05-03 06:09:16 +02:00
},
2016-05-03 22:13:04 +02:00
{
2016-05-10 20:18:36 +02:00
test: /\.scss$/,
loaders: ['style', 'css', 'sass']
2016-05-11 19:19:37 +02:00
},
{
test: /\.(svg|mp3)$/,
2016-05-11 19:19:37 +02:00
loader: 'file'
2016-08-18 20:22:47 +02:00
},
{
test: /fonts\/.*\.(eot|svg|ttf|woff|woff2)$/,
loader: 'file'
2016-05-03 22:13:04 +02:00
}
2016-05-03 06:09:16 +02:00
],
},
2016-08-11 19:24:02 +02:00
};