Add named exports.

`import dat from 'dat.gui'` is now interchangeable with
`import * as dat from 'dat.gui'`
This commit is contained in:
efokschaner 2018-04-30 22:21:34 -07:00 committed by Don McCurdy
parent 4a08249e30
commit fdcd266249
10 changed files with 587 additions and 573 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -44,7 +44,7 @@
"rollup-plugin-node-resolve": "^3.0.2", "rollup-plugin-node-resolve": "^3.0.2",
"rollup-plugin-sass": "^0.5.3", "rollup-plugin-sass": "^0.5.3",
"rollup-plugin-uglify": "^2.0.1", "rollup-plugin-uglify": "^2.0.1",
"serve": "^6.4.8" "serve": "^6.4.8 <6.5.4"
}, },
"eslintConfig": { "eslintConfig": {
"extends": "airbnb-base", "extends": "airbnb-base",

View File

@ -23,6 +23,7 @@ const banner = fs.readFileSync(path.join(__dirname, 'licenseBanner.txt'));
export default { export default {
input: 'src/dat/index.js', input: 'src/dat/index.js',
output: [{ output: [{
exports: 'named',
file: './build/dat.gui.js', file: './build/dat.gui.js',
format: 'umd', format: 'umd',
name: 'dat', name: 'dat',

View File

@ -20,6 +20,7 @@ const banner = fs.readFileSync(path.join(__dirname, 'licenseBanner.txt'));
export default Object.assign({}, defaultConfig, { export default Object.assign({}, defaultConfig, {
output: { output: {
exports: 'named',
file: './build/dat.gui.min.js', file: './build/dat.gui.min.js',
format: 'umd', format: 'umd',
name: 'dat', name: 'dat',

View File

@ -25,17 +25,16 @@ import NumberControllerSlider from './controllers/NumberControllerSlider';
import FunctionController from './controllers/FunctionController'; import FunctionController from './controllers/FunctionController';
import ColorController from './controllers/ColorController'; import ColorController from './controllers/ColorController';
import dom from './dom/dom'; import domImport from './dom/dom';
import GUI from './gui/GUI'; import GUIImport from './gui/GUI';
export default { export const color = {
color: {
Color: Color, Color: Color,
math: math, math: math,
interpret: interpret interpret: interpret
}, };
controllers: { export const controllers = {
Controller: Controller, Controller: Controller,
BooleanController: BooleanController, BooleanController: BooleanController,
OptionController: OptionController, OptionController: OptionController,
@ -45,15 +44,18 @@ export default {
NumberControllerSlider: NumberControllerSlider, NumberControllerSlider: NumberControllerSlider,
FunctionController: FunctionController, FunctionController: FunctionController,
ColorController: ColorController ColorController: ColorController
}, };
dom: { export const dom = { dom: domImport };
dom: dom
}, export const gui = { GUI: GUIImport };
gui: { export const GUI = GUIImport;
GUI: GUI
}, export default {
color,
GUI: GUI controllers,
dom,
gui,
GUI
}; };