1 | const path = require('path'); |
||
2 | const webpack = require('webpack'); |
||
0 ignored issues
–
show
Unused Code
introduced
by
Loading history...
|
|||
3 | const pkg = require('./package.json'); |
||
0 ignored issues
–
show
|
|||
4 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); |
||
0 ignored issues
–
show
|
|||
5 | |||
6 | module.exports = { |
||
7 | entry: './src/index.js', |
||
8 | mode: 'production', // 'development' https://webpack.js.org/configuration/mode/ |
||
9 | |||
10 | output: { |
||
11 | path: path.join(__dirname, 'build'), |
||
12 | filename: 'jquery.nouislider-range-input.js', |
||
13 | libraryTarget: 'umd', |
||
14 | }, |
||
15 | |||
16 | module: { |
||
17 | rules: [ |
||
18 | { |
||
19 | test: /\.js$/, |
||
20 | exclude: /node_modules/, |
||
21 | loader: 'babel-loader', |
||
22 | }, |
||
23 | ], |
||
24 | }, |
||
25 | |||
26 | plugins: [ |
||
27 | // new webpack.BannerPlugin({ |
||
28 | // banner: `${pkg.name}\n${pkg.version}\nTested with jQuery 1.12+\n${pkg.repository.url}\nLicense: ${pkg.license}`, |
||
0 ignored issues
–
show
|
|||
29 | // }), |
||
30 | // new UglifyJsPlugin({ |
||
31 | // beautify: true, |
||
32 | // mangle: false, |
||
33 | // }), |
||
34 | ], |
||
35 | |||
36 | externals: { |
||
37 | jquery: { |
||
38 | commonjs: 'jquery', |
||
39 | commonjs2: 'jquery', |
||
40 | amd: 'jquery', |
||
41 | root: 'jQuery', |
||
42 | }, |
||
43 | nouislider: 'nouislider', |
||
44 | wnumb: 'wnumb', |
||
45 | }, |
||
46 | }; |
||
47 |