woocommerce/packages/js/internal-style-build
Gan Eng Chin b2629c03db
Make Multichannel Marketing the default new UI for Marketing page (#37430)
2023-03-29 21:09:23 +08:00
..
abstracts Remove unused button-style mixins. 2023-03-29 19:06:40 +08:00
changelog Improve element stacking in modals on tablet and mobile (#35733) 2022-11-30 13:28:00 -03: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 Emit error on webpack build when invalid export name used in import for JS (#37195) 2023-03-26 21:42:33 -04:00
package.json Enforce Strict `@types` Dependencies (#37351) 2023-03-23 18:02:20 -07: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,
};