This repository has been archived on 2020-04-22. You can view files and clone it, but cannot push or open issues or pull requests.
victor-hugo/webpack.conf.js

38 lines
793 B
JavaScript
Raw Normal View History

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