Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wenyan-lang/loader
Webpack loader for wenyan-lang
https://github.com/wenyan-lang/loader
webpack-loader wenyan wenyan-lang
Last synced: about 2 months ago
JSON representation
Webpack loader for wenyan-lang
- Host: GitHub
- URL: https://github.com/wenyan-lang/loader
- Owner: wenyan-lang
- License: mit
- Created: 2020-01-29T13:38:14.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T14:16:48.000Z (almost 2 years ago)
- Last Synced: 2024-05-02T01:03:37.471Z (8 months ago)
- Topics: webpack-loader, wenyan, wenyan-lang
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@wenyanlang/loader
- Size: 535 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wenyan-loader
Webpack loader for wenyan-lang
## Install
```bash
npm i -D @wenyan/loader @wenyan/core
```## Webpack Config
```js
// webpack.config.js
module.exports = {
// ...options
module: {
rules: [
{
test: /\.wy$/,
use: [
{
loader: '@wenyan/loader',
options: {
// options of wenyan.compile
strict: true,
romanizeIdentifiers: 'pinyin',
// ...etc
}
}
]
}
]
}
};
```The options field well passed to the wenyan `compile` function. Check [this doc](https://github.com/wenyan-lang/wenyan/wiki/Compiler-API#compiler-options) for details.
## Usage
You can simpily make the `entry` of webpack to `.wy` scripts or require as js modules.
```js
// webpack.config.js
module.exports = {
// ...options
entry: './src/圖靈機.wy',
}
```or
```js
// some js scripts
const turing = require('./圖靈機.wy')
```You can also check out the [examples](./examples).
## TODO
- [ ] A code name
- [ ] Unit tests