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

[NO JIRA]: Update compliation of stylesheets #3707

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build": "run-s build:*",
"build:gulp": "gulp",
"build:unstable__bpk-mixins": "./scripts/scss/generate-unstable__bpk-mixins.sh",
"build:sass": "node scripts/scss/styles-prod.js && rm packages/bpk-stylesheets/index.css",
Copy link
Member Author

Choose a reason for hiding this comment

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

We shouldn't delete this file as we need it

"build:sass": "node scripts/scss/styles-prod.js",
"build:stylesheets": "(cd packages/bpk-stylesheets && node build)",
"check-bpk-dependencies": "node scripts/npm/check-bpk-dependencies.js",
"check-react-versions": "node scripts/npm/check-react-versions.js",
Expand Down Expand Up @@ -55,9 +55,9 @@
"transpile:clean": "rm -rf ./dist",
"transpile:js": "BABEL_ENV=dev babel packages --ignore ./packages/bpk-stylesheets --out-dir dist --extensions \".ts,.tsx,.js,.jsx\" --config-file ./babel.config.js",
"transpile:dts": "tsc --project tsconfig.declaration.json",
"transpile:imports": "node scripts/transpilation/transform-js-scss-css-imports.js",
"transpile:copy-css": "node scripts/transpilation/copy-css.js",
"transpile:copy-utils": "node scripts/transpilation/copy-utils.js",
"transpile:imports": "node scripts/transpilation/transform-js-scss-css-imports.js",
Copy link
Member Author

Choose a reason for hiding this comment

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

Changing the order so that we will capture bpk-stylesheets otherwise the import change would happen before bpk-stylesheets was ready

"transpile:copy-package-json": "cp ./packages/package.json ./dist/",
"transpile:copy-readme": "cp packages/README.md ./dist/"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/bpk-stylesheets/webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,8 @@ module.exports = {
new MiniCssExtractPlugin({
filename: 'base.css',
}),
new MiniCssExtractPlugin({
filename: 'index.css',
}),
Comment on lines +126 to +128
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 complies the code to strip out non browser understandable sass such as global()

],
};
2 changes: 1 addition & 1 deletion scripts/transpilation/transform-js-scss-css-imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ console.log('Crunching import paths...');
// eslint-disable-next-line no-console
console.log('');

const findReplaces = [{ find: '.module.scss', replace: '.module.css' }];
const findReplaces = [{ find: '.scss', replace: '.css' }];
Copy link
Member Author

Choose a reason for hiding this comment

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

Changing this here rather than renaming the files in bpk-stylesheets as that would have created a breaking change folks would need to do if they were using the sass stylesheets over the js


const jsFiles = execSync(
'find dist -name "*.js" -o -name "*.jsx" -name "*.ts" -o -name "*.tsx" | grep -v node_modules',
Expand Down
Loading