@webpackon/use-transpile-modules
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Webpackon

@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'),
  });

Package Sidebar

Install

npm i @webpackon/use-transpile-modules

Weekly Downloads

45

Version

1.0.1

License

MIT

Unpacked Size

5.15 kB

Total Files

7

Last publish

Collaborators

  • and_tem