2017-11-07 12:59:49 +01:00
|
|
|
const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
2016-03-15 23:42:10 +01:00
|
|
|
|
|
|
|
module.exports = {
|
2016-09-15 22:04:15 +02:00
|
|
|
devtool: 'eval',
|
|
|
|
entry: [
|
2018-05-27 12:57:21 +02:00
|
|
|
'webpack/hot/dev-server',
|
|
|
|
'webpack-hot-middleware/client',
|
|
|
|
'./src/scripts/choices',
|
2016-09-15 22:04:15 +02:00
|
|
|
],
|
|
|
|
output: {
|
2018-05-27 12:57:21 +02:00
|
|
|
path: path.resolve('public'),
|
2016-09-15 22:04:15 +02:00
|
|
|
filename: 'choices.min.js',
|
2018-05-27 12:57:21 +02:00
|
|
|
publicPath: 'http://localhost:3001/assets/scripts/',
|
2016-10-18 15:15:00 +02:00
|
|
|
library: 'Choices',
|
|
|
|
libraryTarget: 'umd',
|
2016-09-15 22:04:15 +02:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env': {
|
2017-11-07 12:59:49 +01:00
|
|
|
NODE_ENV: JSON.stringify('development'),
|
|
|
|
},
|
|
|
|
}),
|
2016-09-15 22:04:15 +02:00
|
|
|
],
|
|
|
|
module: {
|
2017-11-07 12:59:49 +01:00
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
enforce: 'pre',
|
|
|
|
test: /\.js?$/,
|
2018-05-27 12:57:21 +02:00
|
|
|
include: path.join(__dirname, 'src/scripts'),
|
2017-11-07 12:59:49 +01:00
|
|
|
exclude: /(node_modules|bower_components)/,
|
|
|
|
loader: 'eslint-loader',
|
|
|
|
query: {
|
|
|
|
configFile: '.eslintrc',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.js?$/,
|
2018-05-27 12:57:21 +02:00
|
|
|
include: path.join(__dirname, 'src/scripts'),
|
2017-11-07 12:59:49 +01:00
|
|
|
exclude: /(node_modules|bower_components)/,
|
|
|
|
loader: 'babel-loader',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2016-10-18 15:15:00 +02:00
|
|
|
};
|