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
812 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: {
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
},
{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/,
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-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$/]
};