Created
February 21, 2020 16:27
-
-
Save Chett23/11496ff58e993b2a10a764fc80cfbaac to your computer and use it in GitHub Desktop.
Webpack common
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
const path = require("path"); | |
const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
module.exports = { | |
devtool: "inline-source-map", | |
output: { | |
path: path.resolve("dist", "assets"), | |
filename: "bundle.js" | |
}, | |
performance: { hints: false }, | |
module: { | |
rules: [ | |
{ | |
test: /\.(js|jsx)$/, | |
exclude: /node_modules/, | |
include: path.resolve(__dirname, 'src'), | |
use: { | |
loader: "babel-loader", | |
} | |
}, | |
{ | |
test: /\.(s*)css$/, | |
use: [ | |
{ | |
loader: "style-loader" // Creates style nodes from JS strings. | |
}, | |
{ | |
loader: "css-loader", // Translates CSS into CommonJS. | |
options: { | |
sourceMap: true | |
} | |
} | |
] | |
}, | |
{ | |
test: /\.svg$/, | |
use: ["@svgr/webpack"] | |
} | |
] | |
}, | |
externals: { | |
zendesk_app_framework_sdk: "ZAFClient" | |
}, | |
resolve: { | |
alias: { | |
"@zafClient": path.resolve(__dirname, "src/api/zafClient.js"), | |
"@Components": path.resolve(__dirname, "src/Components"), | |
"@styledComponents": path.resolve( | |
__dirname, | |
"src/Components/styled-components" | |
), | |
"@globalConstants": path.resolve(__dirname, "src/globalConstants.js") | |
} | |
}, | |
plugins: [ | |
new HtmlWebpackPlugin({ | |
template: "src/index.html", | |
hash: true | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
webpack.prod.js