This commit is contained in:
darenhsu
2022-07-17 13:16:16 +08:00
parent 84759556ff
commit befd344ab0
28070 changed files with 4008428 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
registry "https://registry.npmjs.org"
+63
View File
@@ -0,0 +1,63 @@
# Change Log
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
<a name="2.0.0"></a>
# [2.0.0](https://github.com/clarkdo/postcss-import-resolver/compare/v1.2.3...v2.0.0) (2019-10-11)
### Features
* upgrade enhanced-resolve to v4 ([efd663a](https://github.com/clarkdo/postcss-import-resolver/commit/efd663a))
<a name="1.2.3"></a>
## [1.2.3](https://github.com/clarkdo/postcss-import-resolver/compare/v1.2.2...v1.2.3) (2019-05-14)
### Refactor
* Prefer "style" property when resolving ([a79dfa13](https://github.com/jsless/postcss-import-resolver/pull/2))
<a name="1.2.2"></a>
## [1.2.2](https://github.com/clarkdo/postcss-import-resolver/compare/v1.2.1...v1.2.2) (2019-03-29)
### Bug Fixes
* ts commonjs definition ([f115fd6](https://github.com/clarkdo/postcss-import-resolver/commit/f115fd6))
<a name="1.2.1"></a>
## [1.2.1](https://github.com/clarkdo/postcss-import-resolver/compare/v1.2.0...v1.2.1) (2019-03-29)
### Bug Fixes
* ts definition ([667d866](https://github.com/clarkdo/postcss-import-resolver/commit/667d866))
<a name="1.2.0"></a>
# [1.2.0](https://github.com/clarkdo/postcss-import-resolver/compare/v1.1.0...v1.2.0) (2019-03-29)
### Features
* add ts definition ([a6ab9a2](https://github.com/clarkdo/postcss-import-resolver/commit/a6ab9a2))
<a name="1.1.0"></a>
# [1.1.0](https://github.com/clarkdo/postcss-import-resolver/compare/v1.0.1...v1.1.0) (2018-01-17)
### Bug Fixes
* degrade enhanced-resolve to 3.4.1 for compatibility ([62d755e](https://github.com/clarkdo/postcss-import-resolver/commit/62d755e))
<a name="1.0.1"></a>
## 1.0.1 (2018-01-17)
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 Clark Du <clark.duxin@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+40
View File
@@ -0,0 +1,40 @@
declare namespace ImportResolver {
interface AliasItem {
alias: string;
name: string;
onlyModule?: boolean;
}
interface Dictionary<T> {
[key: string]: T;
}
interface Plugin {
apply(...args: any[]): void;
}
interface ResolverOption {
alias?: AliasItem[] | Dictionary<string>;
aliasFields?: string[];
cachePredicate?: (val: Object) => boolean;
descriptionFiles?: string[];
enforceExtension?: boolean;
enforceModuleExtension?: boolean;
extensions?: string[];
fileSystem?: Object;
mainFields?: string[];
mainFiles?: string[];
moduleExtensions?: string[];
modules?: string[];
plugins?: Plugin[];
resolver?: Object;
resolveToContext?: boolean;
symlinks?: string[] | boolean;
unsafeCache?: boolean | Dictionary<any>;
useSyncFileSystemCalls?: boolean;
}
}
declare function resolver(config: ImportResolver.ResolverOption): Function
export = resolver
+22
View File
@@ -0,0 +1,22 @@
const {
NodeJsInputFileSystem,
CachedInputFileSystem,
ResolverFactory
} = require('enhanced-resolve')
module.exports = (config = {}) => {
const defaultConfig = {
extensions: ['.css'],
mainFields: ['style', 'main'],
modules: ['node_modules'],
fileSystem: config.fileSystem
? null
: new CachedInputFileSystem(new NodeJsInputFileSystem(), 4000),
useSyncFileSystemCalls: true
}
const resolver = ResolverFactory.createResolver(
Object.assign(defaultConfig, config)
)
return (id, basedir) => resolver.resolveSync({}, basedir, id)
}
+60
View File
@@ -0,0 +1,60 @@
{
"_args": [
[
"postcss-import-resolver@2.0.0",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
]
],
"_from": "postcss-import-resolver@2.0.0",
"_id": "postcss-import-resolver@2.0.0",
"_inBundle": false,
"_integrity": "sha512-y001XYgGvVwgxyxw9J1a5kqM/vtmIQGzx34g0A0Oy44MFcy/ZboZw1hu/iN3VYFjSTRzbvd7zZJJz0Kh0AGkTw==",
"_location": "/postcss-import-resolver",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "postcss-import-resolver@2.0.0",
"name": "postcss-import-resolver",
"escapedName": "postcss-import-resolver",
"rawSpec": "2.0.0",
"saveSpec": null,
"fetchSpec": "2.0.0"
},
"_requiredBy": [
"/@nuxt/webpack"
],
"_resolved": "https://registry.npmjs.org/postcss-import-resolver/-/postcss-import-resolver-2.0.0.tgz",
"_spec": "2.0.0",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"author": {
"name": "Clark Du"
},
"bugs": {
"url": "https://github.com/clarkdo/postcss-import-resolver/issues"
},
"dependencies": {
"enhanced-resolve": "^4.1.1"
},
"description": "Customize postcss-import resolve with enhanced-resolve",
"devDependencies": {
"eslint": "^4.15.0",
"eslint-config-standard": "^11.0.0-beta.0",
"eslint-plugin-node": "^5.2.1",
"eslint-plugin-standard": "^3.0.1",
"standard-version": "^4.3.0"
},
"homepage": "https://github.com/clarkdo/postcss-import-resolver#readme",
"license": "MIT",
"main": "index.js",
"name": "postcss-import-resolver",
"repository": {
"type": "git",
"url": "git+https://github.com/clarkdo/postcss-import-resolver.git"
},
"scripts": {
"release": "standard-version"
},
"types": "index.d.ts",
"version": "2.0.0"
}
+34
View File
@@ -0,0 +1,34 @@
# postcss-import-resolver
[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard)
## Installation
``` bash
$ npm install --save postcss-import-resolver
# or
$ yarn add postcss-import-resolver
```
## Usage (Webpack)
```js
const resolver = require('postcss-import-resolver')
const postcssLoader = {
loader: 'postcss-loader',
options: {
plugins: {
'postcss-import': {
resolve: resolver({
alias: {
'~': 'src/'
},
modules: ['node_modules']
})
}
}
}
}
```