2017-11-07 12:59:49 +01:00
|
|
|
const path = require('path');
|
2019-02-09 19:13:25 +01:00
|
|
|
const { HotModuleReplacementPlugin } = require('webpack');
|
2016-03-15 23:42:10 +01:00
|
|
|
|
|
|
|
module.exports = {
|
2019-02-09 19:13:25 +01:00
|
|
|
mode: 'development',
|
2016-09-15 22:04:15 +02:00
|
|
|
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
|
|
|
},
|
2019-02-09 19:13:25 +01:00
|
|
|
plugins: [new HotModuleReplacementPlugin()],
|
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'),
|
2019-02-09 19:13:25 +01:00
|
|
|
exclude: /node_modules/,
|
2017-11-07 12:59:49 +01:00
|
|
|
loader: 'eslint-loader',
|
|
|
|
query: {
|
|
|
|
configFile: '.eslintrc',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.js?$/,
|
2018-05-27 12:57:21 +02:00
|
|
|
include: path.join(__dirname, 'src/scripts'),
|
2019-02-09 19:13:25 +01:00
|
|
|
exclude: /node_modules/,
|
2017-11-07 12:59:49 +01:00
|
|
|
loader: 'babel-loader',
|
2019-02-09 19:13:25 +01:00
|
|
|
options: {
|
|
|
|
babelrc: true,
|
|
|
|
},
|
2017-11-07 12:59:49 +01:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2016-10-18 15:15:00 +02:00
|
|
|
};
|