@kkt/raw-modules
v7.5.5
Published
Makes it easy to use the webpack raw-loader.
Downloads
810
Readme
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