@dream-encode/wp-js-plugin-utils 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,6 +4,7 @@ const webpack = require('webpack');
|
|
|
4
4
|
const {
|
|
5
5
|
resolve
|
|
6
6
|
} = require('path');
|
|
7
|
+
const sass = require('sass');
|
|
7
8
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
8
9
|
const RtlCssPlugin = require('rtlcss-webpack-plugin');
|
|
9
10
|
const RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts');
|
|
@@ -11,6 +12,7 @@ const TerserPlugin = require('terser-webpack-plugin');
|
|
|
11
12
|
const DependencyExtractionWebpackPlugin = require('@wordpress/dependency-extraction-webpack-plugin');
|
|
12
13
|
const postcssPlugins = require('@wordpress/postcss-plugins-preset');
|
|
13
14
|
const CSSAssetPlugin = require('./CSSAssetPlugin');
|
|
15
|
+
const sassImporters = typeof sass.NodePackageImporter === 'function' ? [new sass.NodePackageImporter()] : [];
|
|
14
16
|
const tryRequire = id => {
|
|
15
17
|
try {
|
|
16
18
|
return require(id);
|
|
@@ -114,8 +116,12 @@ const createWebpackConfig = (options = {}) => {
|
|
|
114
116
|
}, {
|
|
115
117
|
loader: 'sass-loader',
|
|
116
118
|
options: {
|
|
117
|
-
implementation:
|
|
118
|
-
sourceMap: true
|
|
119
|
+
implementation: sass,
|
|
120
|
+
sourceMap: true,
|
|
121
|
+
api: 'modern',
|
|
122
|
+
sassOptions: {
|
|
123
|
+
importers: sassImporters
|
|
124
|
+
}
|
|
119
125
|
}
|
|
120
126
|
}, {
|
|
121
127
|
loader: require.resolve('postcss-loader'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dream-encode/wp-js-plugin-utils",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Common JS functionality used by custom WP plugins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wordpress",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"postcss-loader": "^8.0.0",
|
|
145
145
|
"react": "^18.0.0",
|
|
146
146
|
"rtlcss-webpack-plugin": "^4.0.0",
|
|
147
|
-
"sass": "^1.
|
|
147
|
+
"sass": "^1.71.0",
|
|
148
148
|
"sass-loader": "^16.0.0",
|
|
149
149
|
"source-map-loader": "^5.0.0",
|
|
150
150
|
"terser-webpack-plugin": "^5.0.0",
|