-
Notifications
You must be signed in to change notification settings - Fork 111
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
add css/scss modules support, back #1174
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
1db1da1
add css/scss modules support, back
delambo df026bd
add postcss back to dev client
delambo d804904
upgrade ci node
delambo 0c9b2eb
appease linter
delambo 944a9f1
new node openssl override
delambo 97ff681
doc fix
delambo a36f102
mise var; yarnrc for integrity issues
delambo 3951c45
support node externals allowlist
delambo e4c2bec
alpha publishes
delambo 83126c0
alpha publishes
delambo aef670b
support webpackhot external on dev server
delambo bb0473f
bundle all css
delambo d4788f1
dev srcmap
delambo 29f76d7
update to faster source map
delambo 476c8ed
custom externals algorithm
delambo a876d88
custom externals algorithm
delambo 9f6ccdd
remove externals dep
delambo 346e076
externals handle no deps in package.json
delambo 0871e9e
externals handle bad package.json resolution in e2e tests
delambo 3a4e92b
webpack 4 bs
delambo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[tools] | ||
node = '20.10.0' | ||
# stuck on this version of yarn because of some weird problems | ||
# related to babel tooling when installing new dependencies | ||
yarn = '1.19.0' | ||
|
||
[env] | ||
MISE_FETCH_REMOTE_VERSIONS_TIMEOUT="300 s" | ||
NODE_OPTIONS = "--openssl-legacy-provider" |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
unsafe-disable-integrity-migration false |
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Works similarly to webpack-node-externals but it's not as | ||
// aggressive. It only excludes top-level dependency-declared | ||
// modules. Respects an `allowList` of regexp's that will be | ||
// used to match modules to include in the bundle. | ||
const { userPackageJSONPath } = require('kyt-utils/paths')(); | ||
|
||
let pkg; | ||
|
||
try { | ||
// eslint-disable-next-line import/no-dynamic-require, global-require | ||
pkg = require(userPackageJSONPath); | ||
} catch (e) { | ||
pkg = {}; | ||
} | ||
|
||
module.exports = (allowList = []) => { | ||
// Get all of the dependencies from the package.json | ||
// and filter out the ones that are in the allowList | ||
const packageModules = []; | ||
Object.keys(pkg.dependencies || []).forEach(module => { | ||
allowList.forEach(allowedModule => { | ||
if (!allowedModule.test(module)) packageModules.push(module); | ||
}); | ||
}); | ||
|
||
return [ | ||
// eslint-disable-next-line consistent-return | ||
(context, request, callback) => { | ||
function getModuleName(requested) { | ||
const scopedModuleRegex = new RegExp( | ||
'@[a-zA-Z0-9][\\w-.]+/[a-zA-Z0-9][\\w-.]+([a-zA-Z0-9./]+)?', | ||
'g' | ||
); | ||
const req = requested; | ||
const delimiter = '/'; | ||
|
||
// Check if scoped module. For example: @company/boring-module | ||
if (scopedModuleRegex.test(req)) { | ||
// reset regexp | ||
scopedModuleRegex.lastIndex = 0; | ||
return req.split(delimiter, 2).join(delimiter); | ||
} | ||
return req.split(delimiter)[0]; | ||
} | ||
if (packageModules.includes(getModuleName(request))) { | ||
// Mark this module as EXTERNAL | ||
return callback(null, `commonjs ${request}`); | ||
} | ||
// Include module in bundle / NOT EXTERNAL | ||
callback(); | ||
}, | ||
]; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
postcssOptions: { | ||
plugins: [['autoprefixer', {}]], | ||
}, | ||
}; |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
18.x?
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.
I added support for 20. That includes support for 18. So why not 🤷?