Skip to content

Commit

Permalink
fix: fix the issue of path changes by build
Browse files Browse the repository at this point in the history
  • Loading branch information
hexf00 committed Feb 27, 2024
1 parent 568428c commit 0bac3c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/webpack-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export interface IUniverPluginOptions {
css?: boolean
}

const nodeRequire = require

export class UniverPlugin {
private name = 'UniverPlugin'

Expand Down Expand Up @@ -71,7 +73,7 @@ export class UniverPlugin {
if (module.resource && rule.test(module.resource)) {
module.loaders.unshift({
ident: 'add-import-css',
loader: require.resolve('./loader'),
loader: nodeRequire.resolve('./loader'),
type: null,
options: {},
})
Expand All @@ -83,7 +85,7 @@ export class UniverPlugin {
if (module.resource && rule.test(module.resource)) {
module.loaders.unshift({
ident: 'add-import-css',
loader: require.resolve('./loader'),
loader: nodeRequire.resolve('./loader'),
type: null,
options: {},
})
Expand Down

0 comments on commit 0bac3c7

Please sign in to comment.