-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
65 lines (59 loc) · 1.41 KB
/
webpack.config.dev.js
File metadata and controls
65 lines (59 loc) · 1.41 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
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var webpack = require("webpack");
module.exports = {
// Defines the entrypoint of our application.
entry: [path.resolve(__dirname, 'src/currency-component.js')],
// Bundle to ./dst.
output: {
path: path.resolve(__dirname, 'dst'),
filename: 'currency-component.js'
},
// Make sure we include sourcemaps. This is for the bundled
// code, not the uglfied code (we uglify with npm run build,
// see package.json for details).
devtool: 'source-map',
// Define externals (things we don't pack).
externals: {
angular: 'angular',
},
module: {
loaders: [
{
test: /\.js/,
loader: 'babel',
include: __dirname + '/src',
},
{
test: /\.css/,
loaders: ['style', 'css'],
include: __dirname + '/src'
}
],
preLoaders: [
{
test: /\.js$/,
exclude: [
path.resolve('node_modules/')
],
loader: 'babel'
},{
test: /\.js$/,
include: path.resolve('src/'),
loader: 'ng-annotate'
},
{
test: /\.html$/,
include: path.resolve('src/'),
loader: "html-loader"
}
]
},
babel: {
presets: ['es2015']
},
plugins: [
new ExtractTextPlugin("currency-component.css"),
new webpack.HotModuleReplacementPlugin()
]
};