@kkt/raw-modules
TypeScript icon, indicating that this package has built-in type declarations

7.5.5 • Public • Published

@kkt/raw-modules

npm version

Makes it easy to use the webpack raw-loader

Installation

yarn add --dev @kkt/raw-modules
# or use npm if you don't have yarn yet
npm install --save-dev @kkt/raw-modules

Usage

In the .kktrc.js or .kktrc.ts you created for kkt add this code:

import path from 'path';
import rawModules from '@kkt/raw-modules';

export default (conf, evn, options) => {
  return rawModules(conf, evn, options);
}

In package.json, add a separate npm script to build library

{
  "scripts": {
    ...
    "build": "kkt build",
    "start": "kkt start",
    ...
  }
}

And you can now use CRA to build your library

Configurations

import path from 'path';
import rawModules from '@kkt/raw-modules';

export default (conf, evn, options) => {
  return rawModules(conf, evn, {
    /**
     * test @defalut /\.md$/i 
     **/
    test: /\.(txt|md)$/i,
    /**
     * esModule @defalut true 
     **/
    esModule: false,
  });
}

License

Licensed under the MIT License

Readme

Keywords

Package Sidebar

Install

npm i @kkt/raw-modules

Weekly Downloads

79

Version

7.5.5

License

MIT

Unpacked Size

4.23 kB

Total Files

5

Last publish

Collaborators

  • uiwjs
  • wcjiang