Transpile untranspiled modules from your node_modules
.
Makes it easy to have local libraries and keep a slick, manageable dev experience.
@weco/next-plugin-transpile-modules
is this one support Next's with-typescript
plugin: you can transpile TypeScript files.
npm install --save next-plugin-transpile-modules
or
yarn add next-plugin-transpile-modules
Classic:
// next.config.js
const withTM = require('next-plugin-transpile-modules');
module.exports = withTM({
transpileModules: ['somemodule', 'oranother']
});
With with-typescript
:
const withTypescript = require('@zeit/next-typescript');
const withTM = require('./plugins/with-transpiled-modules');
module.exports = withTypescript(
withTM({
transpileModules: ['somemodule', 'oranother']
})
);