rollup / rollup-plugin-commonjs

This module has moved and is now available at @rollup/plugin-commonjs / https://github.com/rollup/plugins/blob/master/packages/commonjs
MIT License
502 stars 126 forks source link

createCommonjsModule is not a function when preserveModules is set 'true' #374

Closed shrihari-balasubramani closed 4 years ago

shrihari-balasubramani commented 5 years ago

My rollup config looks like this:

import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import postcss from 'rollup-plugin-postcss';
import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';

export default {
  input: 'src/components/Button/SomeButton.js',
  output: {
    dir: 'deployed',
    format: 'esm'
  },
  preserveModules: true,
  external: [
    'react'
  ],
  plugins: [
    commonjs({
      include: 'node_modules/**'
    }),  
    resolve({preferBuiltins: false}),      
    json({
      include: 'node_modules/**'
    }),
    babel({
      exclude: 'node_modules/**', // only transpile our source code,
      runtimeHelpers: true
    }),     
    postcss({
      config:false,
      plugins: [],
      extensions: ['.css'],
      extract: false
    })   
  ]
};
screenshot 2019-02-13 at 7 26 39 pm
shellscape commented 4 years ago

Hey folks (this is a canned reply, but we mean it!). Thanks to everyone who participated in this issue. We're getting ready to move this plugin to a new home at https://github.com/rollup/plugins, and we have to do some spring cleaning of the issues to make that happen. We're going to close this one, but it doesn't mean that it's not still valid.

We've got some time yet before the move while we resolve pending Pull Requests, so if this issue is still relevant, please @ me and I'll make sure it gets reopened and transferred to the new repo. :beer: