-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: using new transform and bundle task framework
- Loading branch information
Showing
27 changed files
with
714 additions
and
1,246 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@ice/pkg': major | ||
--- | ||
|
||
feat: using new transform and bundle task framework |
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,12 @@ | ||
import { loadPkg } from './load.js'; | ||
import consola from 'consola'; | ||
|
||
const pkg = loadPkg(process.cwd()); | ||
|
||
export function checkDependencyExists(dependency: string, link: string) { | ||
if (!pkg?.dependencies?.[dependency]) { | ||
consola.error(`当前组件/库依赖 \`${dependency}\`, 请运行命令 \`npm i ${dependency} --save\` 安装此依赖。更多详情请看 \`${link}\``); | ||
process.exit(1); | ||
} | ||
return pkg?.dependencies?.[dependency]; | ||
} |
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 @@ | ||
import { createFilter } from '@rollup/pluginutils'; | ||
|
||
/** | ||
* default include src/**.m?[jt]sx? but exclude .d.ts file | ||
* | ||
* @param extraInclude include other file types | ||
* @param extraExclude exclude other file types | ||
* | ||
* @example exclude node_modules createScriptsFilter([], [/node_modules/]) | ||
*/ | ||
export const createScriptsFilter = ( | ||
extraIncludes: RegExp[] = [], | ||
extraExcludes: RegExp[] = [], | ||
) => { | ||
// Match non node_modules files. In ICEPKG V2, we only compile src/**.m?[jt]sx? files. | ||
const includes = [/^(?!.*node_modules\/).*\.(?:[cm]?[jt]s|[jt]sx)$/].concat(extraIncludes); | ||
|
||
const notCompiledDeps = ['core-js', 'core-js-pure', 'tslib', '@swc/helpers', '@babel/runtime', 'babel-runtime']; | ||
const excludes = [/\.d\.ts$/, new RegExp(`node_modules/(${notCompiledDeps.join('|')})`)].concat(extraExcludes); | ||
return createFilter(includes, excludes); | ||
}; |
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
Oops, something went wrong.