Skip to content

Commit

Permalink
build: update rollup and plugins version
Browse files Browse the repository at this point in the history
  • Loading branch information
tiborux authored Feb 9, 2022
1 parent bfaa206 commit 98680c1
Show file tree
Hide file tree
Showing 9 changed files with 5,242 additions and 36,189 deletions.
10 changes: 7 additions & 3 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
> 1%
last 2 versions
not dead
> 0.65% and last 3 versions and not dead
not op_mob > 0
not baidu > 0
not ie >= 0
not ie_mob >= 0
not op_mini all
not and_uc >= 0
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: [
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining'
]
};
22 changes: 15 additions & 7 deletions build/instrumentation.build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import buble from '@rollup/plugin-buble';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import resolve from '@rollup/plugin-node-resolve';
Expand Down Expand Up @@ -61,8 +60,21 @@ export function createConfig({
sourcemap: true,
assetFileNames: '[name][extname]',
entryFileNames: 'app.js',
chunkFileNames: chunkInfo => {
switch (chunkInfo.name) {
case 'main':
return 'x-core-[hash].js';
case 'x-modal':
return 'x-empty-search-[hash].js';
case 'index':
return 'x-search-[hash].js';
default:
return '[name].[hash].js';
}
},
...output
},
preserveEntrySignatures: 'strict',
plugins: [
del(
mergeConfig('del', {
Expand All @@ -75,7 +87,8 @@ export function createConfig({
// Resolving plugins
replace(
mergeConfig('replace', {
'process.env.NODE_ENV': JSON.stringify('production')
'process.env.NODE_ENV': JSON.stringify('production'),
preventAssignment: true
})
),
commonjs(mergeConfig('commonjs')),
Expand All @@ -102,11 +115,6 @@ export function createConfig({
})
),
json(),
buble(
mergeConfig('buble', {
include: ['**/*.js', '**/*.mjs']
})
),
styles(
mergeConfig('styles', {
mode: extractCss ? ['extract', outputCss] : 'inject',
Expand Down
Loading

0 comments on commit 98680c1

Please sign in to comment.