forked from marmelab/ng-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
54 lines (49 loc) · 1.64 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
var ExtractTextPlugin = require('extract-text-webpack-plugin');
function getEntrySources(sources) {
if (process.env.NODE_ENV !== 'production') { // for live reload
sources.push('webpack-dev-server/client?http://0.0.0.0:8000');
}
return sources;
}
var ngAdminSources = [
'./src/javascripts/ng-admin.js',
'./src/sass/ng-admin.scss'
];
var ngAdminAndVendorSources = [
'./src/javascripts/ng-admin.js',
'./src/javascripts/vendors.js',
'font-awesome/scss/font-awesome.scss',
'bootstrap-sass/assets/stylesheets/_bootstrap.scss',
'nprogress/nprogress.css',
'humane-js/themes/flatty.css',
'textangular/src/textAngular.css',
'codemirror/lib/codemirror.css',
'codemirror/addon/lint/lint.css',
'ui-select/dist/select.css',
'./src/sass/ng-admin.scss'
];
module.exports = {
entry: {
'ng-admin': getEntrySources(ngAdminAndVendorSources),
'ng-admin-only': getEntrySources(ngAdminSources)
},
output: {
publicPath: "http://localhost:8000/",
filename: "build/[name].min.js"
},
module: {
loaders: [
{ test: /\.js/, loaders: ['babel'], exclude: /node_modules[\\\/](?!admin-config)/ },
{ test: /\.js/, loaders: ['ng-annotate'] },
{ test: /\.html$/, loader: 'html' },
{ test: /\.(woff2?|svg|ttf|eot)(\?.*)?$/, loader: 'url' },
{ test: /\.css$/, loader: ExtractTextPlugin.extract('css') },
{ test: /\.scss$/, loader: ExtractTextPlugin.extract('css!sass') }
]
},
plugins: [
new ExtractTextPlugin('build/[name].min.css', {
allChunks: true
})
]
};