Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
a90d93fc
Commit
a90d93fc
authored
Nov 10, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix win system dynamicImport error
parent
1093ec3e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
24 deletions
+14
-24
cdn.ts
build/vite/cdn.ts
+0
-21
index.ts
build/vite/plugin/dynamicImport/index.ts
+4
-1
dynamicImport.ts
src/utils/helper/dynamicImport.ts
+1
-0
routeHelper.ts
src/utils/helper/routeHelper.ts
+0
-1
yarn.lock
yarn.lock
+9
-1
No files found.
build/vite/cdn.ts
deleted
100644 → 0
View file @
1093ec3e
const
css
=
[
'
//cdn.bootcdn.net/ajax/libs/nprogress/0.2.0/nprogress.min.css
'
];
// TODO use esm?
const
js
=
[
'
//cdn.bootcdn.net/ajax/libs/vue/3.0.0/vue.global.prod.js
'
,
'
//cdn.bootcdn.net/ajax/libs/vue-router/4.0.0-beta.13/vue-router.global.min.js
'
,
'
//cdn.bootcdn.net/ajax/libs/vuex/4.0.0-beta.4/vuex.global.prod.js
'
,
'
//cdn.bootcdn.net/ajax/libs/axios/0.19.2/axios.min.js
'
,
'
//cdn.bootcdn.net/ajax/libs/qs/6.9.4/qs.min.js
'
,
'
//cdn.bootcdn.net/ajax/libs/nprogress/0.2.0/nprogress.min.js
'
,
// '//cdn.bootcdn.net/ajax/libs/lodash.js/4.17.15/lodash.min.js',
// '//cdn.bootcdn.net/ajax/libs/crypto-js/3.3.0/crypto-js.min.js',
// '//cdn.bootcdn.net/ajax/libs/vue-i18n/8.18.1/vue-i18n.min.js',
];
export
const
externals
=
[
'
vue
'
,
'
vuex
'
,
'
vue-router
'
,
'
axios
'
,
'
qs
'
,
'
nprogress
'
];
export
const
cdnConf
=
{
css
,
js
,
};
build/vite/plugin/dynamicImport/index.ts
View file @
a90d93fc
...
...
@@ -17,7 +17,10 @@ const dynamicImportTransform = function (env: any = {}): Transform {
return
{
test
({
path
})
{
// Only convert the file
return
path
.
includes
(
'
/src/utils/helper/dynamicImport.ts
'
);
return
(
path
.
includes
(
'
/src/utils/helper/dynamicImport.ts
'
)
||
path
.
includes
(
`\\src\\utils\\helper\\dynamicImport.ts`
)
);
},
transform
({
code
})
{
const
{
VITE_DYNAMIC_IMPORT
}
=
env
;
...
...
src/utils/helper/dynamicImport.ts
View file @
a90d93fc
// The content here is just for type approval. The actual file content is overwritten by transform
export
default
function
(
id
:
string
)
{
const
dynamicImportModule
:
any
=
id
;
return
dynamicImportModule
;
...
...
src/utils/helper/routeHelper.ts
View file @
a90d93fc
...
...
@@ -53,7 +53,6 @@ export function genRouteModule(moduleList: AppRouteModule[]) {
}
// 动态引入
// TODO 错误写法
function
asyncImportRoute
(
routes
:
AppRouteRecordRaw
[]
|
undefined
)
{
if
(
!
routes
)
return
;
routes
.
forEach
((
item
)
=>
{
...
...
yarn.lock
View file @
a90d93fc
...
...
@@ -6944,7 +6944,7 @@ rollup@^1.31.1:
"@types/node" "*"
acorn "^7.1.0"
rollup@^2.32.1:
rollup@^2.32.1
, rollup@^2.33.1
:
version "2.33.1"
resolved "https://registry.npmjs.org/rollup/-/rollup-2.33.1.tgz#802795164164ee63cd47769d8879c33ec8ae0c40"
integrity sha512-uY4O/IoL9oNW8MMcbA5hcOaz6tZTMIh7qJHx/tzIJm+n1wLoY38BLn6fuy7DhR57oNFLMbDQtDeJoFURt5933w==
...
...
@@ -8162,6 +8162,14 @@ vfile@^4.0.0:
unist-util-stringify-position "^2.0.0"
vfile-message "^2.0.0"
vite-plugin-cdn@^1.0.0-beta.3:
version "1.0.0-beta.3"
resolved "https://registry.npmjs.org/vite-plugin-cdn/-/vite-plugin-cdn-1.0.0-beta.3.tgz#5846e80debba5e3968169931f5cba86aea5701cd"
integrity sha512-1oepxSSr8rROFhyP93EWVasKHAAbGfp3QyUrUmJW/zU80CvFPyHATckk8vy08pMiulErSqATjfofTJ+TxP4wkw==
dependencies:
lodash "^4.17.20"
rollup "^2.33.1"
vite-plugin-html@^1.0.0-beta.2:
version "1.0.0-beta.2"
resolved "https://registry.npmjs.org/vite-plugin-html/-/vite-plugin-html-1.0.0-beta.2.tgz#f30cdba4ca70469e62b770e32c407ce5d7f9b544"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment