-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack-web.config.js
More file actions
75 lines (74 loc) · 2.48 KB
/
webpack-web.config.js
File metadata and controls
75 lines (74 loc) · 2.48 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
var path = require('path');
var webpack = require("webpack");
module.exports = {
entry:
{
ngmainpage: './appConfig/MainAppNg.js',
requirementpage: './appConfig/RequireMentcfg.js',
},
node: {
__dirname: true
},
output: {
// Absolute output directory
path: __dirname + '/build',
chunkFilename: '[name].js',
filename: '[name].bundle.js',
},
module: {
loaders: [
{
loader: 'babel-loader',
test: [
path.join(__dirname, 'appConfig'),
path.join(__dirname, 'controller'),
path.join(__dirname, 'model'),
path.join(__dirname, 'unit'),
path.join(__dirname, 'services')],
query: {
presets: 'es2015',
},
},
{
test: /[\/\\]node_modules[\/\\]some-module[\/\\]index\.js$/,
loader: "imports?this=>window"
},
{
// I want to uglify with mangling only app files, not thirdparty libs
test: /build\/mainpage\/.*\.js$/,
exclude: /Scripts/, // excluding .spec files
loader: "uglify"
},
]
},
plugins: [
// Avoid publishing files when compilation fails
new webpack.NoErrorsPlugin(),
],
stats: {
// Nice colored output
colors: true
},
// Create Sourcemaps for the bundle
devtool: 'source-map',
//resolve jquery
resolve: {
modulesDirectories: ['node_modules'],
alias: {
'angular': '../node_modules/angular/angular.min',
'angular-ui-router': '../node_modules/angular-ui-router/release/angular-ui-router.min',
'angular.animate': '../node_modules/angular-animate/angular-animate.min',
'ng.ueditor': "../plugins/Ueditor/angular-ueditor",
'ng.treeView': '../plugins/NgTreeView/abn_tree_directive'
},
module: {
loaders: [
{ test: /angular/, loader: 'expose?angular!expose?Angular' }, //Angular
{ test: /angular-ui-router/, loader: 'exports?angular-ui-router!imports?angular' },
{ test: /ng.ueditor/, loader: 'exports?ng.ueditor!imports?angular' },
{ test: /angular.animate/, loader: 'exports?angular.animate!imports?angular' },
{ test: /ng.treeView/, loader: 'exports?ng.treeView!imports?angular' },
]
}
},
};