@wenyanlang/loader

0.0.2 • Public • Published

wenyan-loader

Webpack loader for wenyan-lang

Install

npm i -D @wenyanlang/loader @wenyanlang/core

Webpack Config

// webpack.config.js
module.exports = {
  // ...options
  module: {
    rules: [
      {
        test: /\.wy$/,
        use: [
          {
            loader: '@wenyanlang/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.

Usage

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.

TODO

  • [ ] A code name
  • [ ] Unit tests

Package Sidebar

Install

npm i @wenyanlang/loader

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

3.87 kB

Total Files

4

Last publish

Collaborators

  • antfu
  • lingdong