mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-26 14:54:27 +02:00
Rename variables
This commit is contained in:
@@ -15,8 +15,8 @@ const globby = require('globby')
|
||||
const { babel } = require('@rollup/plugin-babel')
|
||||
const banner = require('./banner.js')
|
||||
|
||||
const srcPath = path.resolve(__dirname, '../js/src/').replace(/\\/g, '/')
|
||||
const jsFiles = globby.sync(srcPath + '/**/*.js')
|
||||
const sourcePath = path.resolve(__dirname, '../js/src/').replace(/\\/g, '/')
|
||||
const jsFiles = globby.sync(sourcePath + '/**/*.js')
|
||||
|
||||
// Array which holds the resolved plugins
|
||||
const resolvedPlugins = []
|
||||
@@ -31,7 +31,7 @@ for (const file of jsFiles) {
|
||||
dist: file.replace('src', 'dist'),
|
||||
fileName: path.basename(file),
|
||||
className: filenameToEntity(path.basename(file))
|
||||
// safeClassName: filenameToEntity(path.relative(srcPath, file))
|
||||
// safeClassName: filenameToEntity(path.relative(sourcePath, file))
|
||||
})
|
||||
}
|
||||
|
||||
|
@@ -48,9 +48,9 @@ const files = [
|
||||
]
|
||||
|
||||
for (const file of files) {
|
||||
fs.readFile(file.file, 'utf8', (err, data) => {
|
||||
if (err) {
|
||||
throw err
|
||||
fs.readFile(file.file, 'utf8', (error, data) => {
|
||||
if (error) {
|
||||
throw error
|
||||
}
|
||||
|
||||
const algo = 'sha384'
|
||||
|
@@ -9,7 +9,7 @@ const banner = require('./banner.js')
|
||||
const BUNDLE = process.env.BUNDLE === 'true'
|
||||
const ESM = process.env.ESM === 'true'
|
||||
|
||||
let fileDest = `bootstrap${ESM ? '.esm' : ''}`
|
||||
let fileDestination = `bootstrap${ESM ? '.esm' : ''}`
|
||||
const external = ['@popperjs/core']
|
||||
const plugins = [
|
||||
babel({
|
||||
@@ -24,7 +24,7 @@ const globals = {
|
||||
}
|
||||
|
||||
if (BUNDLE) {
|
||||
fileDest += '.bundle'
|
||||
fileDestination += '.bundle'
|
||||
// Remove last entry in external array to bundle Popper
|
||||
external.pop()
|
||||
delete globals['@popperjs/core']
|
||||
@@ -41,7 +41,7 @@ const rollupConfig = {
|
||||
input: path.resolve(__dirname, `../js/index.${ESM ? 'esm' : 'umd'}.js`),
|
||||
output: {
|
||||
banner,
|
||||
file: path.resolve(__dirname, `../dist/js/${fileDest}.js`),
|
||||
file: path.resolve(__dirname, `../dist/js/${fileDestination}.js`),
|
||||
format: ESM ? 'esm' : 'umd',
|
||||
globals,
|
||||
generatedCode: 'es2015'
|
||||
|
Reference in New Issue
Block a user