From 78f29d2b3cb9bd888c927e8d50ee6962c2f9d407 Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Sun, 27 Aug 2017 15:46:32 +0900 Subject: Update URL for supported browsers --- build/postcss.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'build') diff --git a/build/postcss.config.js b/build/postcss.config.js index aef4679fa..cadd98d03 100644 --- a/build/postcss.config.js +++ b/build/postcss.config.js @@ -9,7 +9,7 @@ module.exports = (ctx) => ({ browsers: [ // // Official browser support policy: - // https://v4-alpha.getbootstrap.com/getting-started/browsers-devices/#supported-browsers + // https://getbootstrap.com/docs/4.0/getting-started/browsers-devices/#supported-browsers // 'Chrome >= 45', // Exact version number here is kinda arbitrary 'Firefox ESR', -- cgit v1.2.3 From 0165a620ec5826289dd56c0683c413e7a5b47fcb Mon Sep 17 00:00:00 2001 From: Herst Date: Thu, 31 Aug 2017 16:03:41 +0200 Subject: Adapt UglifyJS config for IE10 See mishoo/UglifyJS2#2198 --- build/uglifyjs.config.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'build') diff --git a/build/uglifyjs.config.json b/build/uglifyjs.config.json index 2b53a56d9..5085f4186 100644 --- a/build/uglifyjs.config.json +++ b/build/uglifyjs.config.json @@ -1,5 +1,8 @@ { - "output" : { + "output": { "comments": "/^!/" - } + }, + "compress": { + "typeofs": false + } } -- cgit v1.2.3 From 9936bf59444c402b653f28449529eab83794e911 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Tue, 29 Aug 2017 21:16:00 +0200 Subject: Create a bundled release of Bootstrap with Popper.js inside --- build/rollup.config.js | 43 +++++++++++++++++++++++++++++++++++++++++++ build/stamp.js | 44 +++++++++++--------------------------------- 2 files changed, 54 insertions(+), 33 deletions(-) create mode 100644 build/rollup.config.js (limited to 'build') diff --git a/build/rollup.config.js b/build/rollup.config.js new file mode 100644 index 000000000..7cec6ef1c --- /dev/null +++ b/build/rollup.config.js @@ -0,0 +1,43 @@ +const path = require('path') +const babel = require('rollup-plugin-babel') +const resolve = require('rollup-plugin-node-resolve') +const BUNDLE = process.env.BUNDLE === 'true' + +var fileDest = 'bootstrap.js' +var external = ['jquery', 'popper.js'] +const plugins = [ + babel({ + exclude: 'node_modules/**', // only transpile our source code + externalHelpersWhitelist: [ // include only required helpers + 'typeof', + 'classCallCheck', + 'createClass', + 'inherits', + 'possibleConstructorReturn' + ] + }) +] +const globals = { + jquery: '$', + 'popper.js': 'Popper' +} + +if (BUNDLE) { + fileDest = 'bootstrap.bundle.js' + // remove last entry in external array to bundle Popper + external.pop() + delete globals['popper.js'] + plugins.push(resolve()) +} + +module.exports = { + input: path.resolve(__dirname, '../js/src/index.js'), + output: { + file: path.resolve(__dirname, `../dist/js/${fileDest}`), + format: 'iife' + }, + name: 'bootstrap', + external: external, + globals: globals, + plugins: plugins +} diff --git a/build/stamp.js b/build/stamp.js index 8cde189d7..2135c60a3 100644 --- a/build/stamp.js +++ b/build/stamp.js @@ -1,41 +1,19 @@ -const fs = require('fs') +const fs = require('fs') +const path = require('path') +const pkg = require(path.resolve(__dirname, '../package.json')) +const year = new Date().getFullYear() -fs.readFile('package.json', (err, data) => { - if (err) { - throw err - } +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 pkg = JSON.parse(data) - const year = new Date().getFullYear() - - const stampTop = +const stamp = `/*! * Bootstrap v${pkg.version} (${pkg.homepage}) * Copyright 2011-${year} ${pkg.author} * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ - -if (typeof jQuery === 'undefined') { - throw new Error('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.') -} - -(function ($) { - var version = $.fn.jquery.split(' ')[0].split('.') - if ((version[0] < 3) || (version[0] >= 4)) { - throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v3.0.0 but less than v4.0.0') - } -})(jQuery); - -(function () { ` - const stampEnd = ` -})();` - - process.stdout.write(stampTop) - - process.stdin.on('end', () => { - process.stdout.write(stampEnd) - }) - - process.stdin.pipe(process.stdout) -}) +fs.writeFileSync(pathBoostrap, `${stamp}${contentFile}`, { encoding: 'UTF8' }) +fs.writeFileSync(pathBootstrapBundle, `${stamp}${contentBundleFile}`, { encoding: 'UTF8' }) -- cgit v1.2.3 From c3fe53cd42d8055b596f287e37497bc65d52eecf Mon Sep 17 00:00:00 2001 From: Johann-S Date: Thu, 31 Aug 2017 19:00:51 +0200 Subject: Use rollup to add our copyright instead of a custom script --- build/rollup.config.js | 10 +++++++++- build/stamp.js | 19 ------------------- 2 files changed, 9 insertions(+), 20 deletions(-) delete mode 100644 build/stamp.js (limited to 'build') diff --git a/build/rollup.config.js b/build/rollup.config.js index 7cec6ef1c..d6eb0cf5d 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -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 index 2135c60a3..000000000 --- a/build/stamp.js +++ /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' }) -- cgit v1.2.3