2023-07-17 17:25:14 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
const WebpackRTLPlugin = require( 'webpack-rtl-plugin' );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
Update to pnpm 9.1 (#47385)
* 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>
2024-05-13 13:57:39 +00:00
|
|
|
const {
|
|
|
|
webpackConfig,
|
|
|
|
plugin,
|
|
|
|
} = require( '@woocommerce/internal-style-build' );
|
2023-07-17 17:25:14 +00:00
|
|
|
|
|
|
|
const NODE_ENV = process.env.NODE_ENV || 'development';
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
mode: process.env.NODE_ENV || 'development',
|
|
|
|
entry: {
|
|
|
|
'build-style': __dirname + '/src/style.scss',
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
path: __dirname,
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
parser: webpackConfig.parser,
|
|
|
|
rules: webpackConfig.rules,
|
|
|
|
},
|
|
|
|
plugins: [
|
Update to pnpm 9.1 (#47385)
* 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>
2024-05-13 13:57:39 +00:00
|
|
|
new plugin( {
|
2023-07-17 17:25:14 +00:00
|
|
|
filename: ( data ) => {
|
|
|
|
return data.chunk.name.startsWith( '/build/blocks' )
|
|
|
|
? `[name].css`
|
|
|
|
: `[name]/style.css`;
|
|
|
|
},
|
|
|
|
chunkFilename: 'chunks/[id].style.css',
|
|
|
|
} ),
|
|
|
|
new WebpackRTLPlugin( {
|
|
|
|
test: /(?<!style)\.css$/,
|
|
|
|
filename: '[name]-rtl.css',
|
|
|
|
minify: NODE_ENV === 'development' ? false : { safe: true },
|
|
|
|
} ),
|
|
|
|
new WebpackRTLPlugin( {
|
|
|
|
test: /style\.css$/,
|
|
|
|
filename: '[name]/style-rtl.css',
|
|
|
|
minify: NODE_ENV === 'development' ? false : { safe: true },
|
|
|
|
} ),
|
|
|
|
],
|
|
|
|
};
|