Skip to content

Commit

Permalink
fix: npm installation error (#1697)
Browse files Browse the repository at this point in the history
fixes #1696
  • Loading branch information
rubiin committed Jul 16, 2021
1 parent 01eeaef commit cff8a2e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
48 changes: 23 additions & 25 deletions build-browser.js
@@ -1,34 +1,32 @@
/* eslint import/no-extraneous-dependencies: 0 */
import fs from 'fs';
import { rollup } from 'rollup';
import babel from 'rollup-plugin-babel';
import babelPresetEnv from '@babel/preset-env';
import pkg from './package.json';
import fs from "fs";
import { rollup } from "rollup";
import babel from "rollup-plugin-babel";
import babelPresetEnv from "@babel/preset-env";
import pkg from "./package.json";

rollup({
entry: 'src/index.js',
entry: "src/index.js",
plugins: [
babel({
presets: [[babelPresetEnv, { modules: false }]],
babelrc: false,
}),
],
}).then(bundle => (
bundle.write({
dest: 'validator.js',
format: 'umd',
moduleName: pkg.name,
banner: (
`/*!\n${
String(fs.readFileSync('./LICENSE'))
.trim()
.split('\n')
.map(l => ` * ${l}`)
.join('\n')
}\n */`
),
})
)).catch((e) => {
process.stderr.write(`${e.message}\n`);
process.exit(1);
});
})
.then((bundle) =>
bundle.write({
dest: "validator.js",
format: "umd",
moduleName: pkg.name,
banner: `/*!\n${String(fs.readFileSync("./LICENSE"))
.trim()
.split("\n")
.map((l) => ` * ${l}`)
.join("\n")}\n */`,
})
)
.catch((e) => {
process.stderr.write(`${e.message}\n`);
process.exit(1);
});
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -48,7 +48,7 @@
"mocha": "^6.2.3",
"nyc": "^14.1.0",
"rimraf": "^3.0.0",
"rollup": "^0.43.0",
"rollup": "^0.47.0",
"rollup-plugin-babel": "^4.0.1",
"uglify-js": "^3.0.19"
},
Expand All @@ -72,4 +72,4 @@
"node": ">= 0.10"
},
"license": "MIT"
}
}

1 comment on commit cff8a2e

@SACfisher
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't understand jscript can you giv me a source to learn

Please sign in to comment.