Choices/webpack.config.dev.js

47 lines
1.1 KiB
JavaScript
Raw Normal View History

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: [
'webpack/hot/dev-server',
'webpack-hot-middleware/client',
'./src/scripts/choices',
2016-09-15 22:04:15 +02:00
],
output: {
path: path.resolve('public'),
2016-09-15 22:04:15 +02:00
filename: 'choices.min.js',
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?$/,
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?$/,
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
};