forked from bcabanes/angular-image-cropper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
48 lines (42 loc) · 1.16 KB
/
webpack.config.js
File metadata and controls
48 lines (42 loc) · 1.16 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
var webpack = require('webpack');
var config = {
context: __dirname + '/dev',
entry: './app/app.js',
output: {
path: __dirname + '/dev',
filename: 'bundle.js'
},
plugins: [
new webpack.DefinePlugin({
ON_TEST: process.env.NODE_ENV === 'test'
})
],
devtool: 'eval-source-map', // Dev only! Creating a source-map on the fly.
module: {
loaders: [
{
exclude: /node_modules/,
test: /\.css$/,
loader: 'style-loader!css-loader'
},
{
exclude: /node_modules/,
test: /\.scss$/,
loader: 'style-loader!css-loader!sass-loader'
}
]
}
};
if (process.env.NODE_ENV === 'production') {
config.context = __dirname + '/src';
config.entry = './index.js';
config.output.path = __dirname + '/dist';
config.output.filename = 'angular-image-cropper.js';
config.output.library = 'imageCropper';
config.output.libraryTarget = 'umd';
// require("angular") is external and available on the global var angular.
config.externals = { angular: 'angular' };
//config.plugins.push(new webpack.optimize.UglifyJsPlugin());
config.devtool = 'source-map';
}
module.exports = config;