forked from SidebarJS/angular-sidebarjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
44 lines (43 loc) · 1.25 KB
/
webpack.config.js
File metadata and controls
44 lines (43 loc) · 1.25 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
const path = require('path');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: {
'angular-sidebarjs': './src/angular-sidebarjs.js',
'angular-sidebarjs.min': './src/angular-sidebarjs.js',
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
},
resolve: {
alias: {
'~core': path.resolve(__dirname, 'node_modules/sidebarjs/dist/'),
},
},
module: {
rules: [{
test: /\.js$/,
use: [
{loader: 'ng-annotate-loader?single_quotes'},
{loader: 'babel-loader'},
],
exclude: /node_modules/,
}, {
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [{loader: 'css-loader', options: {url: false}}],
}),
},
],
},
plugins: [
new CleanWebpackPlugin(['dist'], {verbose: false}),
new ExtractTextPlugin('[name].css', {allChunks: true}),
new UglifyJsPlugin({include: /\.min\.js$/}),
new OptimizeCssAssetsPlugin({assetNameRegExp: /\.min\.css$/}),
],
};