JSPM

  • Created
  • Published
  • Downloads 116
  • Score
    100M100P100Q72786F
  • License MIT

Makes it easy to use the webpack raw-loader.

Package Exports

  • @kkt/raw-modules

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@kkt/raw-modules) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@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