forked from comozilla/parapara-canvas-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
41 lines (40 loc) · 1.21 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
const webpack = require("webpack");
module.exports = {
cache: true,
entry: "./js/main.js",
output: {
path: __dirname,
filename: "./js/build/bundle.js"
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: "babel",
query: {
cacheDirectory: true,
presets: ["es2015"]
}
},
{ test: /\.css$/, loader: "style-loader!css-loader" },
// 下のものは、url-loaderでやると1ファイルにまとまっていいが、
// font-awesomeが特別な種類のフォントを使っている問題でまとめられないからfile-loaderでやっている
{
test: /\.(ttf|eot|svg|woff2|woff)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "file?name=js/build/[path][name].[ext]"
}
]
},
resolve: {
modulesDirectories: ["web_modules", "node_modules", "bower_components"],
alias: {
"font-awesome": "font-awesome/css/font-awesome.css",
"web-animations-js": "web-animations-js/web-animations-next.min.js"
}
},
plugins: [new webpack.ResolverPlugin(
new webpack.ResolverPlugin
.DirectoryDescriptionFilePlugin("bower.json", ["main"])
)]
};