Webpack loader for wenyan-lang
npm i -D @wenyan/loader @wenyan/core
// 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 for details.
You can simpily make the entry
of webpack to .wy
scripts or require as js modules.
// webpack.config.js
module.exports = {
// ...options
entry: './src/圖靈機.wy',
}
or
// some js scripts
const turing = require('./圖靈機.wy')
You can also check out the examples.
- A code name
- Unit tests