-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
443dc97
commit 0aaa8a6
Showing
27 changed files
with
404 additions
and
45 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
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
22 changes: 22 additions & 0 deletions
22
test/form/samples/normalize-external-paths/normalize-false/_config.js
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,22 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
description: 'does not normalize external paths when set to false', | ||
options: { | ||
normalizeExternalPaths: false, | ||
external(id) { | ||
if (['./relativeUnresolved.js', '../relativeUnresolved.js', '/absolute.js'].includes(id)) | ||
return true; | ||
}, | ||
plugins: { | ||
resolveId(source) { | ||
if (source.endsWith('/pluginDirect.js')) return false; | ||
if (source.endsWith('/pluginTrue.js')) return { id: '/pluginTrue.js', external: true }; | ||
if (source.endsWith('/pluginAbsolute.js')) | ||
return { id: '/pluginAbsolute.js', external: 'absolute' }; | ||
if (source.endsWith('/pluginNormalize.js')) | ||
return { id: path.join(__dirname, 'pluginNormalize.js'), external: 'normalize' }; | ||
} | ||
} | ||
} | ||
}; |
32 changes: 32 additions & 0 deletions
32
test/form/samples/normalize-external-paths/normalize-false/_expected.js
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,32 @@ | ||
import { relativeUnresolved as relativeUnresolved$1 } from './relativeUnresolved.js'; | ||
import { absolute } from '/absolute.js'; | ||
import { pluginDirect as pluginDirect$1 } from './pluginDirect.js'; | ||
import { pluginTrue } from '/pluginTrue.js'; | ||
import { pluginAbsolute } from '/pluginAbsolute.js'; | ||
import { pluginNormalize } from './pluginNormalize.js'; | ||
import { relativeUnresolved } from '../relativeUnresolved.js'; | ||
import { pluginDirect } from '../pluginDirect.js'; | ||
|
||
console.log( | ||
'nested', | ||
relativeUnresolved, | ||
relativeMissing, | ||
relativeExisting, | ||
absolute, | ||
pluginDirect, | ||
pluginTrue, | ||
pluginAbsolute, | ||
pluginNormalize | ||
); | ||
|
||
console.log( | ||
'main', | ||
relativeUnresolved$1, | ||
relativeMissing, | ||
relativeExisting, | ||
absolute, | ||
pluginDirect$1, | ||
pluginTrue, | ||
pluginAbsolute, | ||
pluginNormalize | ||
); |
19 changes: 19 additions & 0 deletions
19
test/form/samples/normalize-external-paths/normalize-false/main.js
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,19 @@ | ||
import { relativeUnresolved } from './relativeUnresolved.js'; | ||
import { absolute } from '/absolute.js'; | ||
import { pluginDirect } from './pluginDirect.js'; | ||
import { pluginTrue } from './pluginTrue.js'; | ||
import { pluginAbsolute } from './pluginAbsolute.js'; | ||
import { pluginNormalize } from './pluginNormalize.js'; | ||
import './nested/nested.js'; | ||
|
||
console.log( | ||
'main', | ||
relativeUnresolved, | ||
relativeMissing, | ||
relativeExisting, | ||
absolute, | ||
pluginDirect, | ||
pluginTrue, | ||
pluginAbsolute, | ||
pluginNormalize | ||
); |
18 changes: 18 additions & 0 deletions
18
test/form/samples/normalize-external-paths/normalize-false/nested/nested.js
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,18 @@ | ||
import { relativeUnresolved } from '../relativeUnresolved.js'; | ||
import { absolute } from '/absolute.js'; | ||
import { pluginDirect } from '../pluginDirect.js'; | ||
import { pluginTrue } from '../pluginTrue.js'; | ||
import { pluginAbsolute } from '../pluginAbsolute.js'; | ||
import { pluginNormalize } from '../pluginNormalize.js'; | ||
|
||
console.log( | ||
'nested', | ||
relativeUnresolved, | ||
relativeMissing, | ||
relativeExisting, | ||
absolute, | ||
pluginDirect, | ||
pluginTrue, | ||
pluginAbsolute, | ||
pluginNormalize | ||
); |
Oops, something went wrong.