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
4 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
42 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 | }; |
| 42 |