-
Notifications
You must be signed in to change notification settings - Fork 916
Commit
* adds support for mount:web_modules script * adds tests for custom web_modules mount scripts * adds comment to explain mount:web_modules args
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const execa = require('execa'); | ||
|
||
it('custom web_modules folder', () => { | ||
execa.sync('npm', ['run', 'TEST'], { | ||
cwd: __dirname, | ||
// override NODE_ENV=test from jest, otherwise snowpack will assume | ||
// development mode and try to copy from DEV_DEPENDENCIES_DIR | ||
env: { NODE_ENV: 'production' } | ||
}); | ||
|
||
// should write modules to the custom folder on disk | ||
expect(fs.existsSync(path.join(__dirname, 'build', 'my_modules', 'array-flatten.js'))).toBe(true); | ||
|
||
// should rewrite path for web_modules imports | ||
const outputJS = fs.readFileSync(path.resolve(__dirname, 'build', '_dist_', 'index.js'), 'utf8'); | ||
expect(outputJS).toContain('/my_modules/array-flatten.js'); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.