diff --git a/package.json b/package.json index 70f11c1..5c427a4 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "lerna": "^2.4.0", "minimist": "^1.2.0", "rimraf": "^2.6.2", - "rollup": "^0.51.8", + "rollup": "^0.52.0", "rollup-plugin-buble": "^0.18.0", "rollup-plugin-commonjs": "^8.2.4", "rollup-plugin-node-builtins": "^2.1.2", diff --git a/package.json b/package.json index 70f11c1..5c427a4 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "lerna": "^2.4.0", "minimist": "^1.2.0", "rimraf": "^2.6.2", - "rollup": "^0.51.8", + "rollup": "^0.52.0", "rollup-plugin-buble": "^0.18.0", "rollup-plugin-commonjs": "^8.2.4", "rollup-plugin-node-builtins": "^2.1.2", diff --git a/rollup.config.js b/rollup.config.js index 70c46ab..c480ca4 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,7 +1,6 @@ import PackageUtilities from 'lerna/lib/PackageUtilities'; import Repository from 'lerna/lib/Repository'; import path from 'path'; -import unfreeze from './tools/rollup-plugin-unfreeze/index'; import transpile from 'rollup-plugin-buble'; import resolve from 'rollup-plugin-node-resolve'; import string from 'rollup-plugin-string'; @@ -55,7 +54,6 @@ __VERSION__: repo.version, }), transpile(), - unfreeze(), ]; if (args.prod) @@ -99,10 +97,12 @@ const basePath = path.relative(__dirname, pkg.location); const input = path.join(basePath, 'src/index.js'); const { main, module, bundle } = pkg._package; + const freeze = false; results.push({ banner, input, + freeze, output: [ { file: path.join(basePath, main), @@ -126,6 +126,7 @@ results.push({ banner, input, + freeze, output: { file: path.join(basePath, bundle), format: 'umd', diff --git a/package.json b/package.json index 70f11c1..5c427a4 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "lerna": "^2.4.0", "minimist": "^1.2.0", "rimraf": "^2.6.2", - "rollup": "^0.51.8", + "rollup": "^0.52.0", "rollup-plugin-buble": "^0.18.0", "rollup-plugin-commonjs": "^8.2.4", "rollup-plugin-node-builtins": "^2.1.2", diff --git a/rollup.config.js b/rollup.config.js index 70c46ab..c480ca4 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,7 +1,6 @@ import PackageUtilities from 'lerna/lib/PackageUtilities'; import Repository from 'lerna/lib/Repository'; import path from 'path'; -import unfreeze from './tools/rollup-plugin-unfreeze/index'; import transpile from 'rollup-plugin-buble'; import resolve from 'rollup-plugin-node-resolve'; import string from 'rollup-plugin-string'; @@ -55,7 +54,6 @@ __VERSION__: repo.version, }), transpile(), - unfreeze(), ]; if (args.prod) @@ -99,10 +97,12 @@ const basePath = path.relative(__dirname, pkg.location); const input = path.join(basePath, 'src/index.js'); const { main, module, bundle } = pkg._package; + const freeze = false; results.push({ banner, input, + freeze, output: [ { file: path.join(basePath, main), @@ -126,6 +126,7 @@ results.push({ banner, input, + freeze, output: { file: path.join(basePath, bundle), format: 'umd', diff --git a/tools/rollup-plugin-unfreeze/index.js b/tools/rollup-plugin-unfreeze/index.js deleted file mode 100644 index d696e8b..0000000 --- a/tools/rollup-plugin-unfreeze/index.js +++ /dev/null @@ -1,47 +0,0 @@ -const MagicString = require('magic-string'); - -/** - * This workaround plugin removes `Object.freeze` usage with Rollup - * because there is no way to disable and we need it to - * properly add deprecated methods/classes on namespaces - * such as `PIXI.utils` or `PIXI.loaders`, code was borrowed - * from 'rollup-plugin-replace'. - * @todo Remove this when opt-out option for Rollup is available - * @private - */ -export default function unfreeze() -{ - const pattern = /Object.freeze\s*\(\s*([^)]*)\)/g; - - return { - name: 'unfreeze', - transformBundle(code) - { - const str = new MagicString(code); - let hasReplacements = false; - let match; - - while ((match = pattern.exec(code))) - { - hasReplacements = true; - const start = match.index; - - str.overwrite( - start, - start + match[0].length, - match[1] - ); - } - - if (!hasReplacements) - { - return null; - } - - return { - code: str.toString(), - map: str.generateMap({ hires: true }), - }; - }, - }; -}