Skip to content

Commit

Permalink
fix(build): disable minification for use with patch-package
Browse files Browse the repository at this point in the history
  • Loading branch information
Anidetrix committed May 27, 2020
1 parent a12dadb commit fbba337
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
5 changes: 1 addition & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ module.exports = api => {
api.cache.invalidate(() => process.env.NODE_ENV === "production");

const presets = [["@babel/preset-env", { modules: false, targets: { node: "10" } }]];
const plugins = [
"transform-node-env-inline",
["@babel/plugin-transform-runtime", { useESModules: true }],
];
const plugins = ["@babel/plugin-proposal-class-properties", "transform-node-env-inline"];

if (api.env("test")) presets[0][1].modules = "commonjs";

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"license": "MIT",
"author": "Anton Kudryavtsev <boblobl4@gmail.com>",
"main": "dist/index.js",
"module": "dist/index.es.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"
Expand Down
9 changes: 4 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint node/no-unsupported-features/es-syntax: ["error", { ignores: ["modules"] }] */

import { terser } from "rollup-plugin-terser";
import babel from "@rollup/plugin-babel";
import commonjs from "@rollup/plugin-commonjs";
Expand Down Expand Up @@ -25,8 +27,7 @@ export default [
resolve({ preferBuiltins: true, extensions }),
commonjs(),
typescript(),
babel({ exclude: ["**/node_modules/@babel/**"], babelHelpers: "runtime", extensions }),
prod && terser({ output: { comments: false } }),
babel({ babelHelpers: "bundled", extensions }),
],
},
// Injector
Expand All @@ -39,11 +40,9 @@ export default [
resolve({ preferBuiltins: true }),
commonjs(),
babel({
exclude: ["**/node_modules/@babel/**"],
babelHelpers: "runtime",
babelHelpers: "bundled",
configFile: false,
presets: [["@babel/preset-env", { modules: false, targets: { ie: "8" } }]],
plugins: [["@babel/plugin-transform-runtime", { useESModules: true }]],
}),
prod && terser({ output: { comments: false }, ie8: true, safari10: true }),
],
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es6",
"target": "esnext",
"module": "esnext",
/* Compile Options */
"moduleResolution": "node",
Expand All @@ -21,5 +21,5 @@
/* Paths */
"baseUrl": "."
},
"include": ["src/**/*.ts", "__tests__/**/*.ts"]
"include": ["src/**/*.ts", "__tests__/*.ts"]
}

0 comments on commit fbba337

Please sign in to comment.