@webpackon/use-transpile-modules
v1.0.1
Published
Webpackon use transpile modules
Downloads
3
Maintainers
Readme
@webpackon/use-transpile-modules
Features:
- forces all loaders to process the specified node_modules (suitable for monorepo)
Install
npm i @webpackon/use-transpile-modules --save
yarn add @webpackon/use-transpile-modules
API
const { useTranspileModules } = require('@webpackon/use-transpile-modules');
useTranspileModules(params: UseTranspileModulesParams)(config: WebpackConfig)
UseTranspileModulesParams
export type UseTranspileModulesParams = {
transpileModules: string[];
};
- transpileModules - list of node_modules, that need to transpile
Example
Full example is here
webpack.config.js
const path = require('path');
const { compose } = require('@webpackon/core');
const { useTs } = require('@webpackon/use-ts');
const { useBabel } = require('@webpackon/use-babel');
const { useUrlImages } = require('@webpackon/use-url-images');
const { useTranspileModules } = require('@webpackon/use-transpile-modules');
module.exports = (_, { mode }) =>
compose(
useTranspileModules({ transpileModules: ['my-module'] }),
useBabel({ useTs: true }),
useTs(),
useUrlImages({ mode })
)({
target: 'web',
entry: path.resolve(__dirname, 'src', 'index.tsx'),
});