Skip to content

Commit 9874868

Browse files
committed
feat: make injection optional
1 parent 3444f46 commit 9874868

File tree

4 files changed

+49
-43
lines changed

4 files changed

+49
-43
lines changed

.stylelintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
test
22
dist
3+
*.js

package-lock.json

+40-40
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"eslint": "^5.16.0",
3232
"eslint-config-prettier": "^4.3.0",
3333
"eslint-config-standard": "^12.0.0",
34-
"eslint-plugin-import": "^2.17.3",
34+
"eslint-plugin-import": "^2.22.0",
3535
"eslint-plugin-node": "^9.1.0",
3636
"eslint-plugin-promise": "^4.1.1",
3737
"eslint-plugin-standard": "^4.0.0",
@@ -40,6 +40,7 @@
4040
"kolor": "^1.1.9",
4141
"less": "^3.9.0",
4242
"lodash.camelcase": "^4.3.0",
43+
"lodash.memoize": "^4.1.2",
4344
"pkg-dir": "^4.2.0",
4445
"postcss-values-parser": "^3.0.4",
4546
"prettier": "^1.17.1",

src/inject.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ class Injector {
2727
}
2828
}
2929

30-
export default function inject (less, pluginManager) {
31-
pluginManager.addPreProcessor(new Injector())
30+
export default function inject (_, pluginManager) {
31+
const { inject = true } = this.options || {}
32+
33+
if (inject) {
34+
pluginManager.addPreProcessor(new Injector())
35+
}
3236
}

0 commit comments

Comments
 (0)