提交 3aa1dffa 编写于 作者: fxy060608's avatar fxy060608

fix(nvue): file-loader

上级 424433f5
......@@ -33,6 +33,7 @@
"css": "~2.2.1",
"de-indent": "^1.0.2",
"escodegen": "^1.8.1",
"file-loader": "^6.2.0",
"hash-sum": "^1.0.2",
"he": "^1.1.0",
"less-loader": "^10.0.1",
......
import path from 'path'
import { normalizePath } from '@dcloudio/uni-cli-shared'
import { RuleSetRule } from 'webpack'
export function createFileLoader(): RuleSetRule {
......@@ -7,8 +10,19 @@ export function createFileLoader(): RuleSetRule {
{
loader: 'file-loader',
options: {
publicPath: 'assets',
outputPath: 'assets',
publicPath(_url: string, resourcePath: string) {
return (
'/' +
normalizePath(
path.relative(process.env.UNI_INPUT_DIR, resourcePath)
)
)
},
outputPath(_url: string, resourcePath: string) {
return normalizePath(
path.relative(process.env.UNI_INPUT_DIR, resourcePath)
)
},
},
},
],
......
......@@ -5032,6 +5032,14 @@ file-entry-cache@^6.0.1:
dependencies:
flat-cache "^3.0.4"
file-loader@^6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d"
integrity sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==
dependencies:
loader-utils "^2.0.0"
schema-utils "^3.0.0"
fill-range@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
......@@ -6982,6 +6990,15 @@ loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.4.0:
emojis-list "^3.0.0"
json5 "^1.0.1"
loader-utils@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.0.tgz#e4cace5b816d425a166b5f097e10cd12b36064b0"
integrity sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==
dependencies:
big.js "^5.2.2"
emojis-list "^3.0.0"
json5 "^2.1.2"
localstorage-polyfill@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/localstorage-polyfill/-/localstorage-polyfill-1.0.1.tgz#4b3083d4bc51d23b4158537e66816137413fd31a"
......@@ -9037,7 +9054,7 @@ schema-utils@^2.6.5:
ajv "^6.12.4"
ajv-keywords "^3.5.2"
schema-utils@^3.1.0, schema-utils@^3.1.1:
schema-utils@^3.0.0, schema-utils@^3.1.0, schema-utils@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281"
integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册