-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
61 lines (48 loc) · 1.61 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
55
56
57
58
59
60
61
var path = require('path');
module.exports = {
// set the context (optional)
context: path.join( __dirname, './src'),
// entry: 'index.js',
entry: ['webpack/hot/dev-server', path.resolve(__dirname, './src/index.js')],
output: {
path: path.resolve(__dirname, './www'),
filename: 'app.js'
},
// enable loading modules relatively (without the ../../ prefix)
resolve: {
root: path.join( __dirname, '/src'),
modulesDirectories: ['src', 'www', 'tests', 'node_modules'],
extensions: ['', '.webpack.js', '.js']
},
module: {
loaders: [
// load and compile javascript
{ test: /\.js$/, exclude: /node_modules/, loader:"babel", query: { presets: ['es2015', 'stage-1'] } },
// load css and process less
{ test: /\.css$/, loader: "style!css"},
{ test: /\.scss$/, loaders: ["style", "css", "sass"] },
// load JSON files and HTML
{ test: /\.json$/, loader: "json" },
{ test: /\.html$/, exclude: /node_modules/, loader:"raw" },
// load fonts(inline base64 URLs for <=8k)
{ test: /\.(ttf|eot|svg|otf)$/, loader: "file" },
{ test: /\.woff(2)?$/, loader: "url?limit=8192&minetype=application/font-woff"},
// load images (inline base64 URLs for <=8k images)
{test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'}
]
},
sassLoader: {
includePaths: [
path.resolve(__dirname, "./src"),
path.resolve(__dirname, "./www/lib/ionic")
]
},
// webpack dev server configuration
devServer: {
contentBase: "./src",
noInfo: false,
hot: true
},
// support source maps
devtool: "#inline-source-map"
};