b2d32e9e72
* Add required dependencies for pnpm nx install {package} command * Update pnpm lock file * Add missing deps for packages/* * Change to use relative imports for packages/components * Move ts from deps to devDeps * Add rimraf to packages/* devDependencies for clean command * Add webpack cli to packages dependencies * Add jest-cli to packages devDependencies Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com> |
||
---|---|---|
.. | ||
abstracts | ||
.npmrc | ||
README.md | ||
index.js | ||
package.json |
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/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/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,
};