forked from Choices-js/Choices
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dev.js
42 lines (41 loc) · 984 Bytes
/
webpack.config.dev.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const path = require('path');
const { HotModuleReplacementPlugin } = require('webpack');
module.exports = {
mode: 'development',
entry: [
'webpack/hot/dev-server',
'webpack-hot-middleware/client',
'./src/scripts/choices',
],
output: {
path: path.resolve('public'),
filename: 'choices.min.js',
publicPath: 'http://localhost:3001/assets/scripts/',
library: 'Choices',
libraryTarget: 'umd',
},
plugins: [new HotModuleReplacementPlugin()],
module: {
rules: [
{
enforce: 'pre',
test: /\.js?$/,
include: path.join(__dirname, 'src/scripts'),
exclude: /node_modules/,
loader: 'eslint-loader',
query: {
configFile: '.eslintrc',
},
},
{
test: /\.js?$/,
include: path.join(__dirname, 'src/scripts'),
exclude: /node_modules/,
loader: 'babel-loader',
options: {
babelrc: true,
},
},
],
},
};