-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added build options for umd and cjs with json support
- Loading branch information
Showing
5 changed files
with
84 additions
and
10 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import timezones from './timezones.json'; | ||
export default timezones; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* eslint-env node */ | ||
import resolve from 'rollup-plugin-node-resolve'; | ||
import babel from 'rollup-plugin-babel'; | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import {terser} from 'rollup-plugin-terser'; | ||
import replace from 'rollup-plugin-replace'; | ||
import json from 'rollup-plugin-json'; | ||
import pkg from './package.json'; | ||
|
||
const dependencies = Object.keys(pkg.dependencies); | ||
|
||
export default [ | ||
// Node build. | ||
// No transpilation or bundling other than converstion from es modules to cjs | ||
{ | ||
input: pkg.source, | ||
output: { | ||
file: pkg.main, | ||
format: 'cjs', | ||
interop: false | ||
}, | ||
plugins: [ | ||
json(), | ||
commonjs({ | ||
include: ['node_modules/**', '../../node_modules/**'] | ||
}) | ||
], | ||
external: dependencies | ||
}, | ||
|
||
// Standalone UMD browser build (minified). | ||
// Transpiles to es5 and bundles all dependencies. | ||
{ | ||
input: pkg.source, | ||
output: { | ||
file: pkg['umd:main'], | ||
format: 'umd', | ||
name: 'GhostTimezoneData' | ||
}, | ||
plugins: [ | ||
json(), | ||
resolve({ | ||
browser: true, | ||
preferBuiltins: false | ||
}), | ||
commonjs({ | ||
include: ['node_modules/**', '../../node_modules/**'] | ||
}), | ||
babel({ | ||
exclude: ['node_modules/**', '../../node_modules/**'] | ||
}), | ||
replace({ | ||
'process.env.NODE_ENV': `"${process.env.NODE_ENV}"` | ||
}), | ||
terser() | ||
] | ||
} | ||
]; |