/** * External dependencies */ const RemoveEmptyScriptsPlugin = require( 'webpack-remove-empty-scripts' ); const WebpackRTLPlugin = require( 'webpack-rtl-plugin' ); /** * Internal dependencies */ const { webpackConfig, plugin, StyleAssetPlugin, } = require( '@woocommerce/internal-style-build' ); 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: [ new RemoveEmptyScriptsPlugin(), new plugin( { filename: ( data ) => { return data.chunk.name.startsWith( '/build/blocks' ) ? `[name].css` : `[name]/style.css`; }, chunkFilename: 'chunks/[id].style.css', } ), new WebpackRTLPlugin( { test: /(?