astra-sites
Last commit date
admin
3 years ago
assets
2 years ago
classes
2 years ago
inc
2 years ago
languages
2 years ago
.eslintignore
2 years ago
.eslintrc.js
2 years ago
.prettierignore
2 years ago
.prettierrc.js
2 years ago
astra-sites.php
2 years ago
phpstan-baseline.neon
2 years ago
phpstan.neon
2 years ago
postcss.config.js
2 years ago
readme.txt
2 years ago
tailwind.config.js
2 years ago
webpack.config.js
2 years ago
webpack.config.js
48 lines
| 1 | const RtlCssPlugin = require( 'rtlcss-webpack-plugin' ); |
| 2 | const path = require( 'path' ); |
| 3 | const defaultConfig = require( '@wordpress/scripts/config/webpack.config' ); |
| 4 | |
| 5 | module.exports = { |
| 6 | ...defaultConfig, |
| 7 | entry: path.join( __dirname, 'inc/assets/js/index.js' ), |
| 8 | plugins: [ |
| 9 | ...defaultConfig.plugins, |
| 10 | new RtlCssPlugin( { |
| 11 | filename: '[name]-rtl.css', |
| 12 | } ), |
| 13 | ], |
| 14 | externals: { |
| 15 | react: 'React', |
| 16 | 'react-dom': 'ReactDOM', |
| 17 | }, |
| 18 | module: { |
| 19 | rules: [ |
| 20 | ...defaultConfig.module.rules, |
| 21 | { |
| 22 | test: /\.s[ac]ss$/i, |
| 23 | use: [ |
| 24 | // Compiles Sass to CSS |
| 25 | 'sass-loader', |
| 26 | // PostCSS |
| 27 | 'postcss-loader', |
| 28 | ], |
| 29 | }, |
| 30 | { |
| 31 | test: /\.css$/i, |
| 32 | use: [ |
| 33 | // Translates CSS into CommonJS |
| 34 | 'css-loader', |
| 35 | // PostCSS |
| 36 | 'postcss-loader', |
| 37 | ], |
| 38 | }, |
| 39 | ], |
| 40 | }, |
| 41 | resolve: { |
| 42 | // ... |
| 43 | fallback: { |
| 44 | 'react/jsx-runtime': require.resolve( 'react/jsx-runtime' ), |
| 45 | }, |
| 46 | }, |
| 47 | }; |
| 48 |