@ecomfe/class-names-loader
Advanced tools
@@ -5,2 +5,13 @@ # Changelog | ||
## [2.0.0](https://github.com/ecomfe/class-names-loader/compare/v1.0.0...v2.0.0) (2021-04-30) | ||
### ⚠ BREAKING CHANGES | ||
* Require webpack@5 as peer | ||
### Bug Fixes | ||
* class name assign to function may fail in earlier browsers ([387e94f](https://github.com/ecomfe/class-names-loader/commit/387e94fe8e3f79b8543903574c2f1337c10aabc4)) | ||
## 1.0.0 (2020-11-15) | ||
@@ -7,0 +18,0 @@ |
@@ -23,4 +23,4 @@ "use strict"; | ||
const dependency = resolveClassNamesBind(options.classNamesModule); | ||
const assignModule = loader_utils_1.default.stringifyRequest(this, `!${path_1.default.join(__dirname, 'assign.js')}`); | ||
this.cacheable(); | ||
this.addDependency(dependency); | ||
const remaining = loader_utils_1.default.stringifyRequest(this, '!!' + remainingRequest); | ||
@@ -31,12 +31,7 @@ return ` | ||
import ${options.namedImport ? '* as locals' : 'locals'} from ${remaining}; | ||
import assign from ${assignModule}; | ||
const hasOwn = Object.prototype.hasOwnProperty; | ||
var css = classNames.bind(locals); | ||
assign(locals, css); | ||
const css = classNames.bind(locals); | ||
for (var style in locals) { | ||
if (hasOwn.call(locals, style)) { | ||
Object.defineProperty(css, style, {value: locals[style]}); | ||
} | ||
} | ||
export default css; | ||
@@ -43,0 +38,0 @@ `; |
{ | ||
"name": "@ecomfe/class-names-loader", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Webpack loader to transform style into classNames bindings", | ||
@@ -32,22 +32,21 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.12.3", | ||
"@babel/eslint-parser": "^7.12.1", | ||
"@babel/eslint-plugin": "^7.12.1", | ||
"@ecomfe/eslint-config": "^6.1.0", | ||
"@types/jest": "^26.0.15", | ||
"@types/loader-utils": "^2.0.1", | ||
"@types/webpack": "^4.41.25", | ||
"@typescript-eslint/eslint-plugin": "^4.7.0", | ||
"@typescript-eslint/parser": "^4.7.0", | ||
"classnames": "^2.2.6", | ||
"css-loader": "^5.0.1", | ||
"eslint": "^7.13.0", | ||
"eslint-plugin-jest": "^24.1.3", | ||
"husky": "^4.3.0", | ||
"@babel/core": "^7.14.0", | ||
"@babel/eslint-parser": "^7.13.14", | ||
"@babel/eslint-plugin": "^7.13.16", | ||
"@ecomfe/eslint-config": "^7.1.0", | ||
"@types/jest": "^26.0.23", | ||
"@types/loader-utils": "^2.0.2", | ||
"@typescript-eslint/eslint-plugin": "^4.22.0", | ||
"@typescript-eslint/parser": "^4.22.0", | ||
"classnames": "^2.3.1", | ||
"css-loader": "^5.2.4", | ||
"eslint": "^7.25.0", | ||
"eslint-plugin-jest": "^24.3.6", | ||
"husky": "^6.0.0", | ||
"jest": "^26.6.3", | ||
"standard-version": "^9.0.0", | ||
"standard-version": "^9.2.0", | ||
"style-loader": "^2.0.0", | ||
"ts-jest": "^26.4.4", | ||
"typescript": "^4.0.5", | ||
"webpack": "^5.4.0" | ||
"ts-jest": "^26.5.5", | ||
"typescript": "^4.2.4", | ||
"webpack": "^5.36.1" | ||
}, | ||
@@ -57,7 +56,5 @@ "dependencies": { | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "npm run ci" | ||
} | ||
"peerDependencies": { | ||
"webpack": "5.x" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
11371
18.37%19
-5%10
42.86%60
36.36%2
100%