https://github.com/ulivz/raw-loader-load-json-repro
A reproduction of raw-loader issue (https://github.com/webpack-contrib/raw-loader/issues/91)
https://github.com/ulivz/raw-loader-load-json-repro
Last synced: about 1 month ago
JSON representation
A reproduction of raw-loader issue (https://github.com/webpack-contrib/raw-loader/issues/91)
- Host: GitHub
- URL: https://github.com/ulivz/raw-loader-load-json-repro
- Owner: ulivz
- Created: 2020-04-19T17:58:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-19T18:10:33.000Z (over 5 years ago)
- Last Synced: 2025-02-01T23:12:36.797Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 2.18 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# raw-loader-load-json-repro
## Step to reproduce
1. `git clone https://github.com/ulivz/raw-loader-load-json-repro`
2. `yarn`
3. `npx webpack`
4. You'll got following error:
4. Modify entry `index.js`,comment `json` import and uncomment `js` import:
```diff
- import foo from 'raw-loader!./foo.json' // don't work
+ // import foo from 'raw-loader!./foo.json' // don't work
- // import foo from 'raw-loader!./foo.js' // work
+ import foo from 'raw-loader!./foo.js'export default {
foo,
}
```Ru-run `npx webpack`,the build will be success.
## Expected Behavior
`*.json` should be loaded successfully with raw-loader like the `*.js`;
## Actual Behavior
`*.json` cannot be loaded successfully.