jlengstorf / learn-rollup

This is an example project to accompany a tutorial on using Rollup.
https://code.lengstorf.com/learn-rollup-js/
ISC License
191 stars 61 forks source link

window system using rollup error #12

Closed gongph closed 7 years ago

gongph commented 7 years ago

hello, when i use npm install babel-preset-es2015-rollup and rollup-plugin-babel there is a error:

.babelrc

{
  "presets": [ "es2015-rollup" ]
}

rollup.config.js

import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'

export default {
  entry: 'src/scripts/main.js',
  dest: 'build/js/main.min.js',
  format: 'umd',
  plugins: [ 
    commonjs(),
    babel({
      exclude: 'node_modules/**',
    }) ]
};

package.json

...
"devDependencies": {
    "babel-preset-es2015-rollup": "^1.2.0",
    "rollup": "^0.34.9",
    "rollup-plugin-babel": "^2.6.1",
    "rollup-plugin-buble": "^0.14.0",
    "rollup-plugin-commonjs": "^5.0.5",
    "rollup-watch": "^2.5.0"
  }
...

and then cmd output a error:


D:\workSpace\git\rollup-learning>npm run dev

> rollup-learning@1.0.0 dev D:\workSpace\git\rollup-learning
> rollup -c --watch

checking rollup-watch version...
bundling...
**Error transforming D:\workSpace\git\rollup-learning\src\scripts\main.js with 'babel' plugin: It look
s like your Babel configuration specifies a module transformer. Please disable it. If you're using t
he "es2015" preset, consider using "es2015-rollup" instead. See https://github.com/rollup/rollup-plu
gin-babel#configuring-babel for more information**
Error: Error transforming D:\workSpace\git\rollup-learning\src\scripts\main.js with 'babel' plugin:
It looks like your Babel configuration specifies a module transformer. Please disable it. If you're
using the "es2015" preset, consider using "es2015-rollup" instead. See https://github.com/rollup/rol
lup-plugin-babel#configuring-babel for more information
    at preflightCheck (D:\workSpace\git\rollup-learning\node_modules\rollup-plugin-babel\dist\rollup
-plugin-babel.cjs.js:43:102)
    at Object.transform$1 [as transform] (D:\workSpace\git\rollup-learning\node_modules\rollup-plugi
n-babel\dist\rollup-plugin-babel.cjs.js:104:18)
    at D:\workSpace\git\rollup-learning\node_modules\rollup\src\utils\transform.js:19:35
Type rollup --help for help, or visit https://github.com/rollup/rollup/wiki

D:\workSpace\git\rollup-learning>

waiting online !

gongph commented 7 years ago

Note: I use the window operating system. and node.js version is v6.2.0 and npm version is v3.8.9 . @jlengstorf

jlengstorf commented 7 years ago

Looks like you can solve this using the same solution in #2. See this comment. If that doesn't work, share your repo and we'll get to the bottom of it.

Also, there's no need to link to this issue from other issues to get my attention — that creates a lot of notification noise for people.

gongph commented 7 years ago

ok, i know, thanks!