woocommerce/packages/js/internal-style-build
Sam Seay 35cdc6dc20
Use syncpack to lock pnpm version till we can fix issues (#50828)
2024-08-22 12:34:42 +12:00
..
abstracts [Accessibility] Fix misspelling in inline documentation in packages/js/* (#48640) 2024-06-21 10:28:54 -07:00
changelog Remove duplicate code lines in css (#47122) 2024-05-07 08:35:25 -04:00
.eslintrc.js Prefixed Private JS Packages (#33218) 2022-05-31 15:42:00 -07:00
.npmrc Prefixed Private JS Packages (#33218) 2022-05-31 15:42:00 -07:00
README.md Prefixed Private JS Packages (#33218) 2022-05-31 15:42:00 -07:00
index.js Monorepo: actualize loaders paths filtering for better Webpack performance. (#49714) 2024-07-29 15:20:17 +02:00
package.json Use syncpack to lock pnpm version till we can fix issues (#50828) 2024-08-22 12:34:42 +12:00
style-asset-plugin.js Improve webpack cache-busting version parameter by using file contents hash (#44838) 2024-02-27 08:07:53 +00:00

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,
};