/
webpack.config.js
56 lines (55 loc) · 1.5 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
var path = require('path'),
libPath = path.join(__dirname, 'lib'),
wwwPath = path.join(__dirname, 'www'),
pkg = require('./package.json'),
webpack = require("webpack"),
HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: path.join(libPath, 'index.js'),
output: {
path: wwwPath,
filename: 'prototype-[hash:6].js'
},
module: {
loaders: [{
test: /\.html$/,
loader: 'html'
}, {
test: /\.json$/,
loader: "json"
}, {
test: /\.(png|jpg)$/,
loader: 'file?name=img/[name].[ext]'
}, {
test: /\.css$/,
loader: "style!css"
}, {
test: /\.js$/,
exclude: /(node_modules)/,
loader: "ng-annotate?add=true!babel"
}, {
test: /\.scss$/,
loader: "style!css!autoprefixer!sass"
}, {
test: [/ionicons\.svg/, /ionicons\.eot/, /ionicons\.ttf/, /ionicons\.woff/],
loader: 'file?name=fonts/[name].[ext]'
}]
},
resolve: {
extensions: ['', '.js', '.json', '.scss', '.html'],
root: [
libPath,
path.join(__dirname, 'node_modules')
],
moduleDirectories: [
'node_modules'
]
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
pkg: pkg,
template: path.join(libPath, 'index.html')
})
]
};