-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.plugin.js
41 lines (39 loc) · 1008 Bytes
/
webpack.plugin.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
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const DashboardPlugin = require('webpack-dashboard/plugin');
const webpack = require('webpack');
const path = require('path');
const config = {
context: path.resolve(__dirname, 'src'),
mode: 'production',
target: "web",
entry: {
app: './oMenu.js',
},
devtool: 'source-map',
output: {
path: path.resolve(__dirname, 'lib'),
filename: 'index.js',
library: 'oMenu',
libraryTarget:'umd'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['env']
}
}
}
]
},
plugins: [
new CleanWebpackPlugin(['lib']), //cleans the dist folder
]
};
module.exports = config;