Skip to content

Instantly share code, notes, and snippets.

@kirbysayshi kirbysayshi/.gitignore
Last active Jan 9, 2018

Embed
What would you like to do?
testcast demonstrating rollup getting confused by the presence of "default" as a normal property.
node_modules
dist
package-lock.json
import * as $protobuf from "protobufjs/minimal";
// This causes the following error:
// [!] Error: Cannot split a chunk that has already been edited (2:58 – "$protobuf.roots["default"]")
// Error: Cannot split a chunk that has already been edited (2:58 – "$protobuf.roots["default"]")
// at MagicString$1._splitChunk (/private/tmp/rollup-protobuf-testcase/node_modules/rollup/dist/rollup.js:5250:10)
// at MagicString$1._split (/private/tmp/rollup-protobuf-testcase/node_modules/rollup/dist/rollup.js:5239:51)
// at MagicString$1.overwrite (/private/tmp/rollup-protobuf-testcase/node_modules/rollup/dist/rollup.js:5052:8)
// at Node.MemberExpression.render (/private/tmp/rollup-protobuf-testcase/node_modules/rollup/dist/rollup.js:13334:18)
// at /private/tmp/rollup-protobuf-testcase/node_modules/rollup/dist/rollup.js:11347:56
// at /private/tmp/rollup-protobuf-testcase/node_modules/rollup/dist/rollup.js:11215:17
// at Array.forEach (<anonymous>)
// at Node.eachChild (/private/tmp/rollup-protobuf-testcase/node_modules/rollup/dist/rollup.js:11207:19)
// at Node.render (/private/tmp/rollup-protobuf-testcase/node_modules/rollup/dist/rollup.js:11347:14)
// at Node.MemberExpression.render (/private/tmp/rollup-protobuf-testcase/node_modules/rollup/dist/rollup.js:13339:33)
const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
export const com = {}
{
"name": "rollup-protobuf-testcase",
"version": "0.0.0",
"description": "",
"main": "dist/index.js",
"module": "dist/index.es.js",
"jsnext:main": "dist/index.es.js",
"scripts": {
"rollup": "rollup -c"
},
"license": "UNLICENSED",
"devDependencies": {
"protobufjs": "^6.8.4",
"rollup": "^0.53.3",
"rollup-plugin-commonjs": "^8.2.6",
"rollup-plugin-node-resolve": "^3.0.0"
}
}
import commonjs from 'rollup-plugin-commonjs'
import resolve from 'rollup-plugin-node-resolve'
import pkg from './package.json'
export default {
input: 'index.js',
output: [
{
file: pkg.main,
format: 'cjs'
},
{
file: pkg.module,
format: 'es'
}
],
external: [
],
plugins: [
resolve(),
commonjs()
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.