2020-02-28 23:27:53 +08:00
|
|
|
This is a simple example that shows the usage of a custom parser for json-modules.
|
2019-11-29 01:12:11 +08:00
|
|
|
|
2019-11-29 01:46:08 +08:00
|
|
|
Toml, yaml and json5 files can be imported like other modules without toml-loader.
|
2019-11-29 01:12:11 +08:00
|
|
|
|
|
|
|
# data.toml
|
|
|
|
|
|
|
|
```toml
|
|
|
|
_{{data.toml}}_
|
|
|
|
```
|
|
|
|
|
2019-11-29 01:39:35 +08:00
|
|
|
# data.yaml
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
_{{data.yaml}}_
|
|
|
|
```
|
|
|
|
|
2019-12-01 04:51:03 +08:00
|
|
|
# data.json5
|
2019-11-29 01:39:35 +08:00
|
|
|
|
|
|
|
```json5
|
2019-11-29 23:15:04 +08:00
|
|
|
_{{data.json5}}_
|
2019-11-29 01:39:35 +08:00
|
|
|
```
|
|
|
|
|
2019-11-29 01:12:11 +08:00
|
|
|
# example.js
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
_{{example.js}}_
|
|
|
|
```
|
|
|
|
|
|
|
|
# webpack.config.js
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
_{{webpack.config.js}}_
|
|
|
|
```
|
|
|
|
|
|
|
|
# js/output.js
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
_{{dist/output.js}}_
|
|
|
|
```
|
|
|
|
|
|
|
|
# Info
|
|
|
|
|
|
|
|
## webpack output
|
|
|
|
|
|
|
|
```
|
|
|
|
_{{stdout}}_
|
|
|
|
```
|