-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwebpack.config.js
More file actions
58 lines (52 loc) · 1.4 KB
/
webpack.config.js
File metadata and controls
58 lines (52 loc) · 1.4 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
var Path = require("path");
var Webpack = require("webpack");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var rootPath = __dirname;
var outputPath = Path.join(rootPath, "dist");
module.exports = {
entry: Path.join(rootPath, "src", "app.entry.js"),
output: {
path: outputPath,
filename: "bundle.js"
},
resolve: {
root: Path.join(rootPath, "src"),
extensions: ["", ".js", ".scss", ".css", ".html"]
},
module: {
loaders: [
{
test: /\.js$/,
loader: "babel",
exclude: /node_modules/,
query: {
presets: ["es2015", "stage-2"],
plugins: ["transform-runtime"]
}
},
{
test: /\.html$/,
loader: "html"
},
{
test: /\.(woff|woff2)$/,
loader: "url?limit=10000"
},
{
test: /\.(ttf|eot|svg)$/,
loader: "file"
},
{
test: /\.(png|jpg|jpeg|gif)$/,
loader: "url?limit=10000"
},
{
test: /\.s?css$/,
loader: ExtractTextPlugin.extract("style", ["css", "sass"])
}
]
},
plugins: [
new ExtractTextPlugin("theme.css")
]
};