2db29164f9
* Update to pnpm 9.1 and fix a mini css bug * Add changefile(s) from automation for the following project(s): @woocommerce/tracks, @woocommerce/product-editor, @woocommerce/onboarding, @woocommerce/number, @woocommerce/notices, @woocommerce/navigation, @woocommerce/internal-js-tests, @woocommerce/extend-cart-checkout-block, @woocommerce/expression-evaluation, @woocommerce/explat, @woocommerce/experimental, @woocommerce/eslint-plugin, @woocommerce/dependency-extraction-webpack-plugin, @woocommerce/date, @woocommerce/data, @woocommerce/customer-effort-score, @woocommerce/currency, @woocommerce/csv-export, @woocommerce/create-woo-extension, @woocommerce/create-product-editor-block, @woocommerce/components, @woocommerce/api, @woocommerce/ai, @woocommerce/admin-e2e-tests, woocommerce-blocks, woocommerce-beta-tester, woocommerce, woo-ai * temporarily disable swallowing build output to diagnose issue with perf workflow * Ignore some type issues that commonly resurface when deps slightly change * Fix persistent type issues that have recurred many times * Add more ignores * Fix lint issue * Revert change to swallow build error * Improve access of the config that needs updated build dir. --------- Co-authored-by: github-actions <github-actions@github.com> |
||
---|---|---|
.. | ||
abstracts | ||
changelog | ||
.eslintrc.js | ||
.npmrc | ||
README.md | ||
index.js | ||
package.json | ||
style-asset-plugin.js |
README.md
Style Build Helper
This is a partial Webpack config for building WooCommece component styles using base styles from Gutenberg. It is used to replace the bin/packages/build.js
script.
Usage
Create a webpack.config.js
in your package root that defines the entry
and output
, making use of the rules
and plugins
from @woocommerce/internal-style-build
.
Note: The entry
should be named 'build-style'
so the CSS will get picked up by the main client/
application's CopyWebpackPlugin
config.
// packages/<package-name>/webpack.config.js
import { webpackConfig } from '@woocommerce/internal-style-build';
module.exports = {
mode: process.env.NODE_ENV || 'development',
entry: {
'build-style': __dirname + '/src/style.scss',
},
output: {
path: __dirname,
},
module: {
rules: webpackConfig.rules,
},
plugins: webpackConfig.plugins,
};