Skip to content
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

updating css-loader dep and ts-loader dev dep #440

Closed
wants to merge 3 commits into from

Conversation

weaverryan
Copy link
Member

@weaverryan weaverryan commented Nov 9, 2018

Fixes #438 and fixes #431 and I believe fixes #432

This PR is more interesting than I expected! The latest version of css-loader (1.0) does not have the minimize option. Even though (until now) the older version was locked on our package.json, it may have been possible for users to be using a new version (I believe that should not be possible, but node deps can do strange things).

@@ -82,7 +82,7 @@
"sinon": "^2.3.4",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"ts-loader": "^4.3.0",
"ts-loader": "^5.3.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in devDependencies, so it really just means that we test against this version - the user can install something lower, but they will get a warning. We could also set this to ^5.0.0, which would mean we would test against 5.0.0 in one our test suites. When the user needs to install this, they would be give the command yarn add ts-loader ^5.0.0, but that should install the latest version anyways.

This is needed for the latest version of css-loader, which does not
handle this
@weaverryan
Copy link
Member Author

This has one minor failing test, but is otherwise ready for review

... and also that, due to some old bad code, the .map files were not
being removed correctly for style entries in production.
chunk.files.forEach((filename) => {
// loop in reverse, to avoid issues as we remove items from chunk.files
for (let i = chunk.files.length - 1; i >= 0; --i) {
let filename = chunk.files[i];
if (/\.js(\.map)?(\?[^.]*)?$/.test(filename)) {
fileDeleteCount++;
// remove the output file
delete compilation.assets[filename];
// remove the file, so that it does not dump in the manifest
chunk.files.splice(chunk.files.indexOf(filename), 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chunk.files.indexOf(filename) could be i instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants