Skip to content

Commit

Permalink
Merge pull request mobxjs#1966 from runnez/master
Browse files Browse the repository at this point in the history
fix uglifyjs preamble (fixes mobxjs#1921)
  • Loading branch information
ItamarShDev authored May 23, 2019
2 parents 15beb0c + e76827a commit 9e16d8b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ function runTypeScriptBuild(outDir, target, declarations) {

const rollupPlugins = [require("rollup-plugin-node-resolve")(), require("rollup-plugin-filesize")()]

const licensePreamble = "/** MobX - (c) Michel Weststrate 2015 - 2019 - MIT Licensed */"

function generateBundledModule(inputFile, outputFile, format) {
console.log(`Generating ${outputFile} bundle.`)

Expand All @@ -73,7 +75,7 @@ function generateBundledModule(inputFile, outputFile, format) {
bundle.write({
dest: outputFile,
format,
banner: "/** MobX - (c) Michel Weststrate 2015 - 2018 - MIT Licensed */",
banner: licensePreamble,
exports: "named"
})
)
Expand All @@ -95,15 +97,15 @@ function generateMinified() {
exec(
`${getCmd(
"uglifyjs"
)} --toplevel -m -c warnings=false --preamble "/** MobX - (c) Michel Weststrate 2015 - 2018 - MIT Licensed */" --source-map -o lib/mobx.min.js lib/mobx.prod.js`
)} --toplevel -m -c warnings=false -b beautify=false,preamble='"${licensePreamble}"' --source-map -o lib/mobx.min.js lib/mobx.prod.js`
)
exec(`${getCmd(`envify`)} lib/mobx.umd.js > lib/mobx.prod.umd.js`, {
env: prodEnv
})
exec(
`${getCmd(
`uglifyjs`
)} --toplevel -m -c warnings=false --preamble "/** MobX - (c) Michel Weststrate 2015 - 2018 - MIT Licensed */" --source-map -o lib/mobx.umd.min.js lib/mobx.prod.umd.js`
)} --toplevel -m -c warnings=false -b beautify=false,preamble='"${licensePreamble}"' --source-map -o lib/mobx.umd.min.js lib/mobx.prod.umd.js`
)
shell.rm("lib/mobx.prod.js", "lib/mobx.prod.umd.js")
}
Expand Down

0 comments on commit 9e16d8b

Please sign in to comment.