PluginProbe
Orderable – Restaurant & Food Ordering System / 1.19.0
Orderable – Restaurant & Food Ordering System v1.19.0
0.1.4 0.1.5 0.2.0 1.0.0 1.1.0 1.1.1 1.10.0 1.10.1 1.11.0 1.12.0 1.12.1 1.12.2 1.13.0 1.14.0 1.15.0 1.16.0 1.17.0 1.17.1 1.18.0 1.19.0 1.19.1 1.19.2 1.2.0 1.20.0 1.20.1 All 44 releases
orderable / inc / modules / checkout / blocks / webpack.config.js

webpack.config.js in Orderable – Restaurant & Food Ordering System 1.19.0, at inc/modules/checkout/blocks/webpack.config.js

93 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 const path = require( 'path' );
2 const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
3 const WooCommerceDependencyExtractionWebpackPlugin = require( '@woocommerce/dependency-extraction-webpack-plugin' );
4 const MiniCssExtractPlugin = require( 'mini-css-extract-plugin' );
5
6 // Remove SASS rule from the default config so we can define our own.
7 const defaultRules = defaultConfig.module.rules.filter( ( rule ) => {
8 return String( rule.test ) !== String( /\.(sc|sa)ss$/ );
9 } );
10
11 module.exports = {
12 ...defaultConfig,
13 entry: {
14 index: path.resolve(
15 process.cwd(),
16 'inc',
17 'modules',
18 'checkout',
19 'blocks',
20 'order-date',
21 'src',
22 'js',
23 'index.js'
24 ),
25 'checkout-order-date-block': path.resolve(
26 process.cwd(),
27 'inc',
28 'modules',
29 'checkout',
30 'blocks',
31 'order-date',
32 'src',
33 'js',
34 'block.js'
35 ),
36 'checkout-order-date-block-frontend': path.resolve(
37 process.cwd(),
38 'inc',
39 'modules',
40 'checkout',
41 'blocks',
42 'order-date',
43 'src',
44 'js',
45 'frontend.js'
46 ),
47 },
48 output: {
49 ...defaultConfig.output,
50 path: path.resolve(
51 process.cwd(),
52 'inc',
53 'modules',
54 'checkout',
55 'blocks',
56 'order-date',
57 'build'
58 ),
59 },
60 module: {
61 ...defaultConfig.module,
62 rules: [
63 ...defaultRules,
64 {
65 test: /\.(sc|sa)ss$/,
66 exclude: /node_modules/,
67 use: [
68 MiniCssExtractPlugin.loader,
69 { loader: 'css-loader', options: { importLoaders: 1 } },
70 {
71 loader: 'sass-loader',
72 options: {
73 sassOptions: {
74 includePaths: [ 'src/css' ],
75 },
76 },
77 },
78 ],
79 },
80 ],
81 },
82 plugins: [
83 ...defaultConfig.plugins.filter(
84 ( plugin ) =>
85 plugin.constructor.name !== 'DependencyExtractionWebpackPlugin'
86 ),
87 new WooCommerceDependencyExtractionWebpackPlugin(),
88 new MiniCssExtractPlugin( {
89 filename: `[name].css`,
90 } ),
91 ],
92 };
93