-
Notifications
You must be signed in to change notification settings - Fork 65
/
webpack.config.js
40 lines (38 loc) · 1022 Bytes
/
webpack.config.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
const path = require('path');
const webpack = require('webpack');
const nodeExternals = require('webpack-node-externals');
const ESLintPlugin = require('eslint-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
externalsPresets: { node: true },
externals: [nodeExternals()],
entry: [
'./src/AutoCompleteTextField'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
libraryTarget: 'commonjs2'
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new MiniCssExtractPlugin({ filename: 'bundle.css' }),
new ESLintPlugin()
],
module: {
rules: [
{ test: /\.js?$/, use: ['babel-loader'], exclude: /node_modules/ },
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'], exclude: /node_modules/ }
]
},
resolve: {
modules: [
path.join(__dirname, 'src'),
'node_modules'
]
}
};