@mpxjs/webpack-plugin 2.9.3 → 2.9.5

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.
@@ -1,12 +1,4 @@
1
1
  const runRules = require('./run-rules')
2
- const specMap = {
3
- template: {
4
- wx: require('./template/wx')
5
- },
6
- json: {
7
- wx: require('./json/wx')
8
- }
9
- }
10
2
 
11
3
  module.exports = function getRulesRunner ({
12
4
  type,
@@ -20,7 +12,15 @@ module.exports = function getRulesRunner ({
20
12
  warn,
21
13
  error
22
14
  }) {
23
- const spec = specMap[type] && specMap[type][srcMode] && specMap[type][srcMode]({ warn, error })
15
+ const specMap = {
16
+ template: {
17
+ wx: require('./template/wx')
18
+ },
19
+ json: {
20
+ wx: require('./json/wx')
21
+ }
22
+ }
23
+ const spec = specMap[type]?.[srcMode]?.({ warn, error })
24
24
  if (spec && spec.supportedModes.indexOf(mode) > -1) {
25
25
  const normalizeTest = spec.normalizeTest
26
26
  const mainRules = mainKey ? spec[mainKey] : spec
@@ -1,7 +1,6 @@
1
1
  const postcss = require('postcss')
2
2
  const loadPostcssConfig = require('./load-postcss-config')
3
3
  const { MPX_ROOT_VIEW, MPX_APP_MODULE_ID } = require('../utils/const')
4
- const trim = require('./plugins/trim')
5
4
  const rpx = require('./plugins/rpx')
6
5
  const vw = require('./plugins/vw')
7
6
  const pluginCondStrip = require('./plugins/conditional-strip')
@@ -30,7 +29,7 @@ module.exports = function (css, map) {
30
29
 
31
30
  const inlineConfig = Object.assign({}, mpx.postcssInlineConfig, { defs })
32
31
  loadPostcssConfig(this, inlineConfig).then(config => {
33
- const plugins = [trim] // init with trim plugin
32
+ const plugins = [] // init with trim plugin
34
33
  const options = Object.assign(
35
34
  {
36
35
  to: this.resourcePath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.9.3",
3
+ "version": "2.9.5",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"
@@ -58,7 +58,7 @@
58
58
  "video.js": "^8.6.0"
59
59
  },
60
60
  "peerDependencies": {
61
- "webpack": "^5.48.0"
61
+ "webpack": "^5.75.0"
62
62
  },
63
63
  "publishConfig": {
64
64
  "registry": "https://registry.npmjs.org",
@@ -82,5 +82,5 @@
82
82
  "engines": {
83
83
  "node": ">=14.14.0"
84
84
  },
85
- "gitHead": "d0b4819fb5896f9796417f608eb06277dc5bdfaa"
85
+ "gitHead": "beefb0935f3aa9d3605dd6f31b8cd37094186488"
86
86
  }
@@ -1,15 +0,0 @@
1
-
2
- module.exports = (opts) => {
3
- return {
4
- postcssPlugin: 'trim',
5
- Once: (root) => {
6
- root.walk(({ type, raws }) => {
7
- if (type === 'rule' || type === 'atrule') {
8
- raws.before = raws.after = '\n'
9
- }
10
- })
11
- }
12
- }
13
- }
14
-
15
- module.exports.postcss = true