update
This commit is contained in:
+4
@@ -2,6 +2,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [3.0.3] - 2020-07-25
|
||||
### Fixed
|
||||
- treat `:import` and `:export` statements as pure
|
||||
|
||||
## [3.0.2] - 2019-06-05
|
||||
### Fixed
|
||||
- better handle invalid syntax
|
||||
|
||||
+6
-1
@@ -43,6 +43,8 @@ function normalizeNodeArray(nodes) {
|
||||
function localizeNode(rule, mode, localAliasMap) {
|
||||
const isScopePseudo = node =>
|
||||
node.value === ':local' || node.value === ':global';
|
||||
const isImportExportPseudo = node =>
|
||||
node.value === ':import' || node.value === ':export';
|
||||
|
||||
const transform = (node, context) => {
|
||||
if (context.ignoreNextSpacing && !isSpacing(node)) {
|
||||
@@ -115,9 +117,12 @@ function localizeNode(rule, mode, localAliasMap) {
|
||||
let childContext;
|
||||
const isNested = !!node.length;
|
||||
const isScoped = isScopePseudo(node);
|
||||
const isImportExport = isImportExportPseudo(node);
|
||||
|
||||
if (isImportExport) {
|
||||
context.hasLocals = true;
|
||||
// :local(.foo)
|
||||
if (isNested) {
|
||||
} else if (isNested) {
|
||||
if (isScoped) {
|
||||
if (node.nodes.length === 0) {
|
||||
throw new Error(`${node.value}() can't be empty`);
|
||||
|
||||
+19
-19
@@ -1,32 +1,32 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"postcss-modules-local-by-default@3.0.2",
|
||||
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
|
||||
"postcss-modules-local-by-default@3.0.3",
|
||||
"/home/node/nuxt"
|
||||
]
|
||||
],
|
||||
"_from": "postcss-modules-local-by-default@3.0.2",
|
||||
"_id": "postcss-modules-local-by-default@3.0.2",
|
||||
"_from": "postcss-modules-local-by-default@3.0.3",
|
||||
"_id": "postcss-modules-local-by-default@3.0.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-jM/V8eqM4oJ/22j0gx4jrp63GSvDH6v86OqyTHHUvk4/k1vceipZsaymiZ5PvocqZOl5SFHiFJqjs3la0wnfIQ==",
|
||||
"_integrity": "sha512-e3xDq+LotiGesympRlKNgaJ0PCzoUIdpH0dj47iWAui/kyTgh3CiAr1qP54uodmJhl6p9rN6BoNcdEDVJx9RDw==",
|
||||
"_location": "/postcss-modules-local-by-default",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "postcss-modules-local-by-default@3.0.2",
|
||||
"raw": "postcss-modules-local-by-default@3.0.3",
|
||||
"name": "postcss-modules-local-by-default",
|
||||
"escapedName": "postcss-modules-local-by-default",
|
||||
"rawSpec": "3.0.2",
|
||||
"rawSpec": "3.0.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.0.2"
|
||||
"fetchSpec": "3.0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/css-loader"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.2.tgz",
|
||||
"_spec": "3.0.2",
|
||||
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
|
||||
"_resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.3.tgz",
|
||||
"_spec": "3.0.3",
|
||||
"_where": "/home/node/nuxt",
|
||||
"author": {
|
||||
"name": "Mark Dalgleish"
|
||||
},
|
||||
@@ -35,18 +35,18 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"icss-utils": "^4.1.1",
|
||||
"postcss": "^7.0.16",
|
||||
"postcss": "^7.0.32",
|
||||
"postcss-selector-parser": "^6.0.2",
|
||||
"postcss-value-parser": "^4.0.0"
|
||||
"postcss-value-parser": "^4.1.0"
|
||||
},
|
||||
"description": "A CSS Modules transform to make local scope the default",
|
||||
"devDependencies": {
|
||||
"chokidar-cli": "^1.0.1",
|
||||
"codecov.io": "^0.1.2",
|
||||
"coveralls": "^3.0.2",
|
||||
"eslint": "^5.9.0",
|
||||
"chokidar-cli": "^1.2.3",
|
||||
"codecov.io": "^0.1.6",
|
||||
"coveralls": "^3.1.0",
|
||||
"eslint": "^5.16.0",
|
||||
"istanbul": "^0.4.5",
|
||||
"tape": "^4.0.0"
|
||||
"tape": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
@@ -82,5 +82,5 @@
|
||||
"test": "tape test.js",
|
||||
"travis": "yarn lint && yarn cover -- --report lcovonly"
|
||||
},
|
||||
"version": "3.0.2"
|
||||
"version": "3.0.3"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user