@oroinc/oro-webpack-config-builder 6.1.0-lts13 → 7.0.0

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.
@@ -2,54 +2,11 @@
2
2
  "name": "inject-loader",
3
3
  "version": "4.0.1",
4
4
  "description": "A Webpack loader for injecting code into modules via their dependencies",
5
- "main": "dist/index.js",
6
- "scripts": {
7
- "build": "webpack --config config/webpack.config.js",
8
- "build:test": "webpack --config config/webpack.test.config.js",
9
- "build:release": "yarn run build && mkdir -p ./dist && cp -f ./tmp/index.js ./dist/index.js && cp -f ./tmp/index.js.map ./dist/index.js.map",
10
- "pretest:unit": "yarn build && yarn build:test",
11
- "test:unit": "mocha tmp/testBundle.js --require source-map-support/register",
12
- "test:integration": "./script/integration_test",
13
- "test": "flow && yarn test:unit && yarn test:integration",
14
- "precommit": "pretty-quick --staged"
15
- },
16
- "files": [
17
- "*.md",
18
- "dist"
19
- ],
20
5
  "author": "Justin Morris <desk@pixelbloom.com> (http://pixelbloom.com)",
21
6
  "repository": {
22
7
  "type": "git",
23
8
  "url": "git@github.com:plasticine/inject-loader.git"
24
9
  },
25
10
  "license": "MIT",
26
- "dependencies": {
27
- "babel-core": "~6"
28
- },
29
- "devDependencies": {
30
- "babel-loader": "^7.1.4",
31
- "babel-plugin-add-module-exports": "^0.2.1",
32
- "babel-plugin-transform-flow-strip-types": "^6.22.0",
33
- "babel-preset-es2015": "^6.22.0",
34
- "flow-bin": "^0.69.0",
35
- "husky": "^0.14.3",
36
- "mocha": "^5.0.5",
37
- "prettier": "^1.11.1",
38
- "pretty-quick": "^1.4.1",
39
- "source-map-support": "^0.5.4",
40
- "webpack": "^4.35.0",
41
- "webpack-cli": "^3.3.5"
42
- },
43
- "peerDependencies": {
44
- "webpack": "^1 || ^2 || ^3 || ^4"
45
- },
46
- "keywords": [
47
- "webpack",
48
- "testing",
49
- "loader",
50
- "webpack-loader",
51
- "inject",
52
- "mock",
53
- "mocking"
54
- ]
11
+ "private": true
55
12
  }
@@ -31,7 +31,10 @@ const ErrorHandler = require('./error-handler');
31
31
  const SVGSprite = require('./svg-sprite');
32
32
  const TerserPlugin = require('terser-webpack-plugin');
33
33
  const jsToSCSS = require('./js-to-scss');
34
+ const oroPostcssCleanup = require('./postcss/oro-postcss-cleanup');
35
+ const cleanupPostcssConfig = require('./postcss/cleanup-postcss-config');
34
36
  require('resolve-url-loader');
37
+ require('lezer-loader');
35
38
 
36
39
  class ConfigBuilder {
37
40
  constructor() {
@@ -344,6 +347,10 @@ class ConfigBuilder {
344
347
  publicPath: '/build/_static/',
345
348
  name: this._getVersionedPath('[path][name].[ext]', this.assetVersion)
346
349
  }
350
+ },
351
+ {
352
+ test: /\.grammar$/,
353
+ use: 'lezer-loader'
347
354
  }
348
355
  ]
349
356
  },
@@ -560,7 +567,10 @@ class ConfigBuilder {
560
567
  sourceMap: true,
561
568
  postcssOptions: {
562
569
  plugins: [
563
- require('autoprefixer')
570
+ require('autoprefixer'),
571
+ this._isProduction
572
+ ? oroPostcssCleanup(cleanupPostcssConfig)
573
+ : null
564
574
  ]
565
575
  }
566
576
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oroinc/oro-webpack-config-builder",
3
- "version": "6.1.0-lts13",
3
+ "version": "7.0.0",
4
4
  "author": "Oro, Inc. (https://oroinc.com)",
5
5
  "license": "MIT",
6
6
  "description": "An integration of OroPlatform based applications with the Webpack.",
@@ -25,6 +25,7 @@
25
25
  "html-webpack-plugin": "~5.5.0",
26
26
  "imports-loader": "~4.0.1",
27
27
  "js-yaml": "~4.1.0",
28
+ "lezer-loader": "^0.3.0",
28
29
  "mini-css-extract-plugin": "~2.7.1",
29
30
  "minimist": "~1.2.7",
30
31
  "nan": "~2.17.0",
@@ -0,0 +1,12 @@
1
+ module.exports = {
2
+ declarations: {
3
+ cursor: {
4
+ task: 'remove',
5
+ whenValueEquals: 'hand'
6
+ },
7
+ filter: {
8
+ task: 'remove',
9
+ whenValueEquals: 'gray'
10
+ }
11
+ }
12
+ };
@@ -0,0 +1,29 @@
1
+ module.exports = ({declarations = {}} = {}) => {
2
+ const props = Object.keys(declarations);
3
+
4
+ return {
5
+ postcssPlugin: 'oro-postcss-cleanup',
6
+
7
+ Declaration(decl, {result}) {
8
+ for (let i = 0; i < props.length; i++) {
9
+ const prop = props[i];
10
+ if (decl.prop === prop) {
11
+ declarationParserHelper({declConfig: declarations[prop], decl: decl, result: result});
12
+ break;
13
+ }
14
+ }
15
+ }
16
+ };
17
+
18
+ function declarationParserHelper({declConfig, decl, result}) {
19
+ if (typeof declConfig === 'object' && declConfig.task === 'remove') {
20
+ if (declConfig.whenValueEquals !== undefined && declConfig.whenValueEquals === decl.value) {
21
+ decl.remove();
22
+ }
23
+ } else if (declConfig.task) {
24
+ result.warn(`Unknown task: [${declConfig.task}]`, { node: decl });
25
+ }
26
+ }
27
+ };
28
+
29
+ module.exports.postcss = true;