-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
122f9da
commit 40b5b73
Showing
8 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<p align="center"> | ||
<a href="https://github.com/kktjs/kkt"> | ||
<img src="https://raw.githubusercontent.com/kktjs/kkt/d2bb00dc2d0bd9bb133f3a369d0ad2f5330ed4af/website/kkt.svg?sanitize=true" alt="KKT LOGO"> | ||
</a> | ||
</p> | ||
|
||
<p align="center"> | ||
<h1>@kkt/resolve-fallback</h1> | ||
</p> | ||
|
||
<p align="center"> | ||
<a href="https://www.npmjs.com/package/@kkt/resolve-fallback"> | ||
<img src="https://img.shields.io/npm/v/@kkt/resolve-fallback.svg" alt="npm version"> | ||
</a> | ||
</p> | ||
|
||
fix: https://github.com/kktjs/kkt/issues/412 | ||
|
||
### License | ||
|
||
Licensed under the MIT License |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "@kkt/resolve-fallback", | ||
"version": "7.4.10", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"description": "This will modify the CRA ModuleScopePlugin plugin that prevents to import modules from outside the `src` directory.", | ||
"author": "Kenny Wong <wowohoo@qq.com> (https://github.com/jaywcjlove)", | ||
"repository": "https://github.com/kktjs/kkt.git", | ||
"keywords": [ | ||
"kkt", | ||
"react", | ||
"framework" | ||
], | ||
"license": "MIT", | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"scripts": { | ||
"watch": "tsbb watch --no-esm" | ||
}, | ||
"devDependencies": { | ||
"kkt": "^7.4.10" | ||
}, | ||
"dependencies": { | ||
"assert": "^2.0.0", | ||
"crypto-browserify": "^3.12.0", | ||
"https-browserify": "^1.0.0", | ||
"os-browserify": "^0.3.0", | ||
"stream-browserify": "^3.0.0", | ||
"stream-http": "^3.2.0", | ||
"url": "^0.11.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import webpack, { Configuration } from 'webpack'; | ||
|
||
export default function resolveFallback(conf: Configuration): Configuration { | ||
if (!conf) { | ||
throw Error('KKT:@kkt/resolve-fallback: there is no config found'); | ||
} | ||
conf.resolve.fallback = Object.assign(conf.resolve.fallback || {}, { | ||
crypto: require.resolve('crypto-browserify'), | ||
stream: require.resolve('stream-browserify'), | ||
assert: require.resolve('assert'), | ||
http: require.resolve('stream-http'), | ||
https: require.resolve('https-browserify'), | ||
os: require.resolve('os-browserify'), | ||
url: require.resolve('url'), | ||
}); | ||
conf.plugins = (conf.plugins || []).concat([ | ||
new webpack.ProvidePlugin({ | ||
process: 'process/browser', | ||
Buffer: ['buffer', 'Buffer'], | ||
}), | ||
]); | ||
return conf; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"declaration": true, | ||
"target": "es2017", | ||
"noImplicitAny": true, | ||
"resolveJsonModule": true, | ||
"moduleResolution": "node", | ||
"sourceMap": true, | ||
"outDir": "lib", | ||
"baseUrl": "./" | ||
}, | ||
"include": ["src"] | ||
} |