forked from Choices-js/Choices
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
50 lines (48 loc) · 1.22 KB
/
Copy pathwebpack.config.dev.js
File metadata and controls
50 lines (48 loc) · 1.22 KB
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
43
44
45
46
47
48
49
50
const path = require('path');
const webpack = require('webpack');
const Dashboard = require('webpack-dashboard');
const DashboardPlugin = require('webpack-dashboard/plugin');
const dashboard = new Dashboard();
module.exports = {
devtool: 'eval',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'./src/scripts/src/choices',
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'choices.min.js',
publicPath: '/src/scripts/dist/',
library: 'Choices',
libraryTarget: 'umd',
},
plugins: [
new DashboardPlugin(dashboard.setData),
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development'),
},
}),
],
module: {
rules: [
{
enforce: 'pre',
test: /\.js?$/,
include: path.join(__dirname, 'src/scripts/src'),
exclude: /(node_modules|bower_components)/,
loader: 'eslint-loader',
query: {
configFile: '.eslintrc',
},
},
{
test: /\.js?$/,
include: path.join(__dirname, 'src/scripts/src'),
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
},
],
},
};