Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test: /.svg$/,
use: {
loader: "svg-react-loader"
}
}
]
},
plugins: [
...defaultConfig.plugins,
// @see https://webpack.js.org/loaders/sass-loader/#extracting-style-sheets
new MiniCssExtractPlugin({
filename: "[name].css"
})
],
externals: {
...defaultConfig.externals,
backbone: "Backbone"
}
};
// Create the full configuration for files that will include all the dependencies to keep WordPress pre 5.0.0 compatibility.
const webpackConfigFull = { ...webpackConfig };
// Remove the `DependencyExtractionWebpackPlugin`.
webpackConfigFull.plugins = webpackConfig.plugins.filter(
entry => !(entry instanceof DependencyExtractionWebpackPlugin)
);
// Add the .full suffix to each entry.
webpackConfigFull.entry = Object.keys(webpackConfig.entry)
.filter(entry => "block-editor" !== entry)
.reduce((acc, key) => {
acc[key + ".full"] = webpackConfig.entry[key];
new CopyPlugin([
{
from: path.resolve( process.cwd(), 'src/php' ),
to: path.resolve( process.cwd(), 'health-check' )
},
{
from: path.resolve( process.cwd(), 'docs' ),
to: path.resolve( process.cwd(), 'health-check' )
}
]),
new MiniCssExtractPlugin({
filename: '../css/[name].css',
}),
],
externals: {
...defaultConfig.externals,
react: 'React',
'react-dom': 'ReactDOM',
}
};