]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Use rollup to add our copyright instead of a custom script
authorJohann-S <johann.servoire@gmail.com>
Thu, 31 Aug 2017 17:00:51 +0000 (19:00 +0200)
committerJohann-S <johann.servoire@gmail.com>
Thu, 31 Aug 2017 17:12:32 +0000 (19:12 +0200)
build/rollup.config.js
build/stamp.js [deleted file]
package.json

index 7cec6ef1cc99dfca879bd8b6e14b26b435d65a4a..d6eb0cf5dd2b7f051848ecf7081b061fd4603524 100644 (file)
@@ -1,7 +1,9 @@
 const path    = require('path')
 const babel   = require('rollup-plugin-babel')
 const resolve = require('rollup-plugin-node-resolve')
+const pkg     = require(path.resolve(__dirname, '../package.json'))
 const BUNDLE  = process.env.BUNDLE === 'true'
+const year    = new Date().getFullYear()
 
 var fileDest  = 'bootstrap.js'
 var external  = ['jquery', 'popper.js']
@@ -39,5 +41,11 @@ module.exports = {
   name: 'bootstrap',
   external: external,
   globals: globals,
-  plugins: plugins
+  plugins: plugins,
+  banner: `/*!
+  * Bootstrap v${pkg.version} (${pkg.homepage})
+  * Copyright 2011-${year} ${pkg.author}
+  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+  */
+ `
 }
diff --git a/build/stamp.js b/build/stamp.js
deleted file mode 100644 (file)
index 2135c60..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-const fs   = require('fs')
-const path = require('path')
-const pkg  = require(path.resolve(__dirname, '../package.json'))
-const year = new Date().getFullYear()
-
-const pathBoostrap        = path.resolve(__dirname, '../dist/js/bootstrap.js')
-const pathBootstrapBundle = path.resolve(__dirname, '../dist/js/bootstrap.bundle.js')
-const contentFile         = fs.readFileSync(pathBoostrap, { encoding: 'UTF8' })
-const contentBundleFile   = fs.readFileSync(pathBootstrapBundle, { encoding: 'UTF8' })
-
-const stamp =
-`/*!
- * Bootstrap v${pkg.version} (${pkg.homepage})
- * Copyright 2011-${year} ${pkg.author}
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- */
-`
-fs.writeFileSync(pathBoostrap, `${stamp}${contentFile}`, { encoding: 'UTF8' })
-fs.writeFileSync(pathBootstrapBundle, `${stamp}${contentBundleFile}`, { encoding: 'UTF8' })
index 6ae3476d15077ad70f64d15d70274648467b744d..73ddb69066ad49088b96e1ff6702a30d03a33b32 100644 (file)
@@ -36,7 +36,6 @@
     "js-compile-standalone": "rollup --environment BUNDLE:false --config build/rollup.config.js",
     "js-compile-bundle": "rollup --environment BUNDLE:true --config build/rollup.config.js",
     "js-compile-plugins": "babel --no-babelrc js/src/ --out-dir js/dist/ --source-maps --presets=es2015 --plugins=transform-es2015-modules-strip",
-    "postjs-compile": "node build/stamp.js",
     "js-minify": "npm-run-all --parallel js-minify-*",
     "js-minify-standalone": "uglifyjs --config-file build/uglifyjs.config.json --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
     "js-minify-bundle": "uglifyjs --config-file build/uglifyjs.config.json --output dist/js/bootstrap.bundle.min.js dist/js/bootstrap.bundle.js",