fix: asset resolution when at non-root route (#828)
* ci: test docs-publish * Specify to use prod * Babel should transpile with env set by webpack * chore: production defaults to true; set in --env.production by cli * Remove lingering merge issue * Add minimification plugins * Need relative URLs to find root assets * Default public url to forward slash in define plugin * Don't wrap w/ react-hot-loader if we're building for production * No need to log extensions * Minimize using terser; and minimize css * Import redux from es; this bypasses commonjs as import and fixes our "production build" warning * Split commone webpack build for now to test hotfix * postfix slash * undefined safe env access * Try to fix node_env prod issue w/ redux * Set NODE_ENV production for all prod builds * Syntax error * nix tests * Increase max amount of available memory * Don't run bundle analyzer by default * fix: asset resolution when at non-root route
This commit is contained in:
parent
7c2b444cf9
commit
d48b617e1c
@ -62,8 +62,6 @@ module.exports = (env, argv) => {
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
// Longer build. Let's report progress
|
||||
new webpack.ProgressPlugin(),
|
||||
// Clean output.path
|
||||
new CleanWebpackPlugin(),
|
||||
],
|
||||
|
||||
@ -48,6 +48,38 @@ module.exports = (env, argv) => {
|
||||
output: {
|
||||
path: DIST_DIR,
|
||||
filename: '[name].bundle.[chunkhash].js',
|
||||
publicPath: PUBLIC_URL, // Used by HtmlWebPackPlugin for asset prefix
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.styl$/,
|
||||
use: [
|
||||
{
|
||||
loader: ExtractCssChunksPlugin.loader,
|
||||
options: {
|
||||
hot: process.env.NODE_ENV === 'development',
|
||||
},
|
||||
},
|
||||
{ loader: 'css-loader' },
|
||||
{ loader: 'stylus-loader' },
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(sa|sc|c)ss$/,
|
||||
use: [
|
||||
{
|
||||
loader: ExtractCssChunksPlugin.loader,
|
||||
options: {
|
||||
hot: process.env.NODE_ENV === 'development',
|
||||
},
|
||||
},
|
||||
'css-loader',
|
||||
'postcss-loader',
|
||||
// 'sass-loader',
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
@ -86,13 +118,6 @@ module.exports = (env, argv) => {
|
||||
plugins: [
|
||||
// Uncomment to generate bundle analyzer
|
||||
// new BundleAnalyzerPlugin(),
|
||||
// Longer build. Let's report progress
|
||||
new webpack.ProgressPlugin({
|
||||
entries: false,
|
||||
modules: false,
|
||||
modulesCount: 500,
|
||||
profile: true,
|
||||
}),
|
||||
// Clean output.path
|
||||
new CleanWebpackPlugin(),
|
||||
// "Public" Folder
|
||||
|
||||
Loading…
Reference in New Issue
Block a user