-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Topics/regroup non static files #6346
Changes from all commits
4803d61
e1b8be9
77371b9
59cf18a
366bd97
972fb6b
4042ae1
695cb68
699e5ca
eed6616
d8a8377
87f0ada
cd834ab
414ce25
41f80b6
ef334d2
6f1e987
f1ad758
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
"__PATH_PREFIX__": false, | ||
"___emitter": false | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,13 @@ module.exports = async ({ | |
stage: Stage, | ||
program: any, | ||
}): Promise<WebpackUtilsOptions> => { | ||
const assetRelativeRoot = `static/` | ||
/** | ||
* the leading `../` for assetRelativeRoot is required to ensure | ||
* the static files extracted by webpack are not part of the | ||
* "build-javascript" output path of `/js`. The same technique is | ||
* used for CSS | ||
*/ | ||
const assetRelativeRoot = `../static/` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @m-allanson This had to be treated the same way as the Here are all the build stages: type Stage = "develop" | "develop-html" | "build-javascript" | "build-html" I think in the future it could be a good idea to add discrete build stages for CSS (although CSS in JS makes this a question mark?) and static assets instead of relying on this current workaround. Here's an example of the output folder of your example repository with this commit |
||
const vendorRegex = /(node_modules|bower_components)/ | ||
const supportedBrowsers = program.browserlist | ||
|
||
|
@@ -435,8 +441,8 @@ module.exports = async ({ | |
*/ | ||
plugins.extractText = options => | ||
new MiniCssExtractPlugin({ | ||
filename: `[name].[contenthash].css`, | ||
chunkFilename: `[name].[contenthash].css`, | ||
filename: `../css/[name].[contenthash].css`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, the css is generated in the stage From what I could tell, there's no way of changing the output path (only publicPath?) using What's happening is the system things it's putting the CSS into the If there's a different way to handle this, such as creating |
||
chunkFilename: `../css/[name].[contenthash].css`, | ||
...options, | ||
}) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#6346 (comment) @m-allanson removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍