Skip to content

Commit

Permalink
chore(build): add es2017 format
Browse files Browse the repository at this point in the history
  • Loading branch information
bigopon committed Apr 12, 2022
1 parent b4bc84a commit 05c50d7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
13 changes: 13 additions & 0 deletions build/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ function build() {
}),
]
},
{
input: `src/${LIB_NAME}.ts`,
output: [
{ file: `dist/es2017/${LIB_NAME}.js`, format: 'es', sourcemap: true }
],
external: externalLibs,
plugins: [
typescript({
target: 'es2017',
removeComments: true
}),
]
},
{
input: `src/${LIB_NAME}.ts`,
output: [
Expand Down
21 changes: 16 additions & 5 deletions build/scripts/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,34 @@ const args = require('../tasks/args');
const rollup = require('rollup');
const typescript = require('@rollup/plugin-typescript').default;
const ChildProcess = require('child_process');
const pkg = require('../../package.json');

const { name } = pkg;
const targetFormats = args.format || ['commonjs']; // by default only run devs for commonjs
const targetDir = args.target;

const buildConfigs = {
es: {
es2015: {
output: {
file: 'dist/es2015/index.js',
file: `dist/es2015/${name}.js`,
format: 'es'
},
tsConfig: {
target: 'es2015'
}
},
es2017: {
output: {
file: `dist/es2017/${name}.js`,
format: 'es'
},
tsConfig: {
target: 'es2017'
}
},
amd: {
output: {
file: 'dist/amd/index.js',
file: `dist/amd/${name}.js`,
format: 'amd',
amd: { id: 'aurelia-router' }
},
Expand All @@ -29,7 +40,7 @@ const buildConfigs = {
},
commonjs: {
output: {
file: 'dist/commonjs/index.js',
file: `dist/commonjs/${name}.js`,
format: 'cjs'
},
tsConfig: {
Expand All @@ -38,7 +49,7 @@ const buildConfigs = {
},
'native-modules': {
output: {
file: 'dist/commonjs/index.js',
file: `dist/native-modules/${name}.js`,
format: 'es'
},
tsConfig: {
Expand Down

0 comments on commit 05c50d7

Please sign in to comment.