Makes it easy to use the webpack raw-loader.
npm install @kkt/raw-modules
Makes it easy to use the webpack raw-loader
``bash`
yarn add --dev @kkt/raw-modulesor use npm if you don't have yarn yet
npm install --save-dev @kkt/raw-modules
In the .kktrc.js or .kktrc.ts you created for kkt add this code:
`js
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
`js`
{
"scripts": {
...
"build": "kkt build",
"start": "kkt start",
...
}
}
And you can now use CRA to build your library
`js
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,
});
}
``
Licensed under the MIT License