diff --git a/.babelrc b/.babelrc index eb52c30ac1..bd9c86c1e1 100644 --- a/.babelrc +++ b/.babelrc @@ -8,7 +8,5 @@ } ] ], - "plugins": [ - "transform-es2015-modules-strip" - ] + "plugins": ["external-helpers"] } diff --git a/README.md b/README.md index 3f988e1960..70b215770f 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Several quick start options are available: - [Download the latest release.](https://github.com/twbs/bootstrap/archive/v4.0.0-beta.zip) - Clone the repo: `git clone https://github.com/twbs/bootstrap.git` - Install with [npm](https://www.npmjs.com): `npm install bootstrap@4.0.0-beta` -- Install with [yarn](https://github.com/yarnpkg/yarn): `yarn add bootstrap@4.0.0-beta` +- Install with [yarn](https://yarnpkg.com): `yarn add bootstrap@4.0.0-beta` - Install with [Composer](https://getcomposer.org): `composer require twbs/bootstrap:4.0.0-beta` - Install with [Bower](https://bower.io): `bower install bootstrap#v4.0.0-beta` - Install with [NuGet](https://www.nuget.org): CSS: `Install-Package bootstrap -Pre` Sass: `Install-Package bootstrap.sass -Pre` (`-Pre` is only required until Bootstrap v4 has a stable release). diff --git a/_data/browser-bugs.yml b/_data/browser-bugs.yml index d3f133354b..9756758ddd 100644 --- a/_data/browser-bugs.yml +++ b/_data/browser-bugs.yml @@ -204,7 +204,7 @@ summary: > `table-cell` borders not overlapping despite `margin-right: -1px` upstream_bug: > - Chromium#568691 + Chromium#749848 origin: > Bootstrap#17438, Bootstrap#14237 diff --git a/build/rollup.config.js b/build/rollup.config.js new file mode 100644 index 0000000000..d6eb0cf5dd --- /dev/null +++ b/build/rollup.config.js @@ -0,0 +1,51 @@ +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'] +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, + 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 8cde189d7f..0000000000 --- a/build/stamp.js +++ /dev/null @@ -1,41 +0,0 @@ -const fs = require('fs') - -fs.readFile('package.json', (err, data) => { - if (err) { - throw err - } - - const pkg = JSON.parse(data) - const year = new Date().getFullYear() - - const stampTop = -`/*! - * 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) -}) diff --git a/build/uglifyjs.config.json b/build/uglifyjs.config.json index 2b53a56d96..5085f4186e 100644 --- a/build/uglifyjs.config.json +++ b/build/uglifyjs.config.json @@ -1,5 +1,8 @@ { - "output" : { + "output": { "comments": "/^!/" - } + }, + "compress": { + "typeofs": false + } } diff --git a/docs/4.0/components/breadcrumb.md b/docs/4.0/components/breadcrumb.md index eb286d8471..7a4b5f44ef 100644 --- a/docs/4.0/components/breadcrumb.md +++ b/docs/4.0/components/breadcrumb.md @@ -4,31 +4,36 @@ title: Breadcrumb description: Indicate the current page's location within a navigational hierarchy that automatically adds separators via CSS. group: components --- +## Overview Separators are automatically added in CSS through [`::before`](https://developer.mozilla.org/en-US/docs/Web/CSS/::before) and [`content`](https://developer.mozilla.org/en-US/docs/Web/CSS/content). {% example html %} - - - -{% endexample %} -Similar to our navigation components, breadcrumbs work fine with or without the usage of list markup. + -{% example html %} -