@dream-encode/wp-js-plugin-utils 0.2.2 → 0.2.4
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,9 +116,14 @@ const createWebpackConfig = (options = {}) => {
|
|
|
114
116
|
}, {
|
|
115
117
|
loader: 'sass-loader',
|
|
116
118
|
options: {
|
|
117
|
-
implementation:
|
|
119
|
+
implementation: sass,
|
|
118
120
|
sourceMap: true,
|
|
119
|
-
api: 'modern'
|
|
121
|
+
api: 'modern',
|
|
122
|
+
webpackImporter: false,
|
|
123
|
+
sassOptions: {
|
|
124
|
+
importers: sassImporters,
|
|
125
|
+
loadPaths: [resolve(context, 'node_modules')]
|
|
126
|
+
}
|
|
120
127
|
}
|
|
121
128
|
}, {
|
|
122
129
|
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.4",
|
|
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",
|