Last active
September 10, 2018 11:03
-
-
Save joshuacrass/d0991d53cf9ebf60f7dc6d407556fdfe to your computer and use it in GitHub Desktop.
react-starter webpack common config file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// webpack-common-config.js | |
// This file will contain configuration data that | |
// is shared between development and production builds. | |
const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
const path = require("path"); | |
const paths = require("./paths"); | |
module.exports = { | |
plugins: [ | |
new HtmlWebpackPlugin({ | |
inject: true, | |
template: paths.appHtml | |
}) | |
], | |
resolve: { | |
// File extensions. Add others and needed (e.g. scss, json) | |
extensions: [".js", ".jsx"], | |
modules: ["node_modules"], | |
// Aliases help with shortening relative paths | |
// 'Components/button' === '../../../components/button' | |
alias: { | |
Components: path.resolve(paths.appSrc, "components"), | |
Containers: path.resolve(paths.appSrc, "containers"), | |
Utils: path.resolve(paths.appSrc, "utils") | |
} | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.(png|svg|jpg)$/, | |
use: ["file-loader"] | |
} | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment