2016-07-21 17:33:50 +00:00
|
|
|
import webpack from "webpack";
|
|
|
|
import path from "path";
|
2016-07-03 22:07:47 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
module: {
|
2017-05-23 07:16:47 +00:00
|
|
|
rules: [
|
2016-07-03 22:07:47 +00:00
|
|
|
{
|
|
|
|
test: /\.((png)|(eot)|(woff)|(woff2)|(ttf)|(svg)|(gif))(\?v=\d+\.\d+\.\d+)?$/,
|
2017-05-23 07:16:47 +00:00
|
|
|
loader: "file-loader?name=/[hash].[ext]"
|
2016-07-03 22:07:47 +00:00
|
|
|
},
|
2016-07-21 17:33:50 +00:00
|
|
|
{test: /\.json$/, loader: "json-loader"},
|
2016-07-03 22:07:47 +00:00
|
|
|
{
|
2017-05-23 07:16:47 +00:00
|
|
|
loader: "babel-loader",
|
2016-07-03 22:07:47 +00:00
|
|
|
test: /\.js?$/,
|
|
|
|
exclude: /node_modules/,
|
2016-07-05 18:38:18 +00:00
|
|
|
query: {cacheDirectory: true}
|
2016-07-03 22:07:47 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
new webpack.ProvidePlugin({
|
2017-05-23 07:16:47 +00:00
|
|
|
"fetch": "imports-loader?this=>global!exports?global.fetch!whatwg-fetch"
|
2016-07-21 17:33:50 +00:00
|
|
|
})
|
2016-07-03 22:07:47 +00:00
|
|
|
],
|
|
|
|
|
2016-07-21 17:33:50 +00:00
|
|
|
context: path.join(__dirname, "src"),
|
2016-07-03 22:07:47 +00:00
|
|
|
entry: {
|
2016-07-21 17:33:50 +00:00
|
|
|
app: ["./js/app"]
|
2016-07-03 22:07:47 +00:00
|
|
|
},
|
|
|
|
output: {
|
2016-07-21 17:33:50 +00:00
|
|
|
path: path.join(__dirname, "dist"),
|
|
|
|
publicPath: "/",
|
|
|
|
filename: "[name].js"
|
2016-07-03 22:07:47 +00:00
|
|
|
},
|
|
|
|
externals: [/^vendor\/.+\.js$/]
|
|
|
|
};
|