-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
preserve-symlinks: default to false, to be consistent with nodejs (#28)
read more: browserify/browserify#1742 nodejs/node#3402
- Loading branch information
1 parent
7b700b7
commit 1520c63
Showing
9 changed files
with
148 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!node_modules |
67 changes: 67 additions & 0 deletions
67
test/case/opts-preserve-symlink/__snapshots__/test.js.snap
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,67 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`opts-preserve-symlinks default false 1`] = ` | ||
"/* imported from lib/button/index.css */ | ||
._index_button { | ||
color: green; | ||
} | ||
/* imported from source.css */ | ||
._source_continueButton | ||
{ | ||
color: green; | ||
} | ||
" | ||
`; | ||
|
||
exports[`opts-preserve-symlinks default false 2`] = ` | ||
Object { | ||
"continueButton": "_source_continueButton _index_button", | ||
} | ||
`; | ||
|
||
exports[`opts-preserve-symlinks false 1`] = ` | ||
"/* imported from lib/button/index.css */ | ||
._index_button { | ||
color: green; | ||
} | ||
/* imported from source.css */ | ||
._source_continueButton | ||
{ | ||
color: green; | ||
} | ||
" | ||
`; | ||
|
||
exports[`opts-preserve-symlinks false 2`] = ` | ||
Object { | ||
"continueButton": "_source_continueButton _index_button", | ||
} | ||
`; | ||
|
||
exports[`opts-preserve-symlinks true 1`] = ` | ||
"/* imported from node_modules/button/index.css */ | ||
._index_button { | ||
color: green; | ||
} | ||
/* imported from source.css */ | ||
._source_continueButton | ||
{ | ||
color: green; | ||
} | ||
" | ||
`; | ||
|
||
exports[`opts-preserve-symlinks true 2`] = ` | ||
Object { | ||
"continueButton": "_source_continueButton _index_button", | ||
} | ||
`; |
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,3 @@ | ||
.button { | ||
color: green; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
.continueButton | ||
{ | ||
composes: button from 'button'; | ||
color: green; | ||
} |
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,49 @@ | ||
'use strict'; | ||
|
||
const resolveImports = require('../../../index'); | ||
const setup = require('../../setup'); | ||
|
||
test('opts-preserve-symlinks true', () => { | ||
const {resulting, exports: tokens} = setup( | ||
'local-by-default', | ||
'extract-imports', | ||
'scope', | ||
resolveImports({ | ||
resolve: { | ||
preserveSymlinks: true, | ||
}, | ||
}) | ||
)(__dirname); | ||
|
||
expect(resulting).toMatchSnapshot(); | ||
expect(tokens).toMatchSnapshot(); | ||
}); | ||
|
||
test('opts-preserve-symlinks false', () => { | ||
const {resulting, exports: tokens} = setup( | ||
'local-by-default', | ||
'extract-imports', | ||
'scope', | ||
resolveImports({ | ||
resolve: { | ||
preserveSymlinks: false, | ||
}, | ||
}) | ||
)(__dirname); | ||
|
||
expect(resulting).toMatchSnapshot(); | ||
expect(tokens).toMatchSnapshot(); | ||
}); | ||
|
||
test('opts-preserve-symlinks default false', () => { | ||
const {resulting, exports: tokens} = setup( | ||
'local-by-default', | ||
'extract-imports', | ||
'scope', | ||
// nodejs behaviour: defaults to false | ||
resolveImports({}) | ||
)(__dirname); | ||
|
||
expect(resulting).toMatchSnapshot(); | ||
expect(tokens).toMatchSnapshot(); | ||
}); |