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,35 +25,37 @@ 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 const color = {
Color: Color,
math: math,
interpret: interpret
};
export const controllers = {
Controller: Controller,
BooleanController: BooleanController,
OptionController: OptionController,
StringController: StringController,
NumberController: NumberController,
NumberControllerBox: NumberControllerBox,
NumberControllerSlider: NumberControllerSlider,
FunctionController: FunctionController,
ColorController: ColorController
};
export const dom = { dom: domImport };
export const gui = { GUI: GUIImport };
export const GUI = GUIImport;
export default { export default {
color: { color,
Color: Color, controllers,
math: math, dom,
interpret: interpret gui,
}, GUI
controllers: {
Controller: Controller,
BooleanController: BooleanController,
OptionController: OptionController,
StringController: StringController,
NumberController: NumberController,
NumberControllerBox: NumberControllerBox,
NumberControllerSlider: NumberControllerSlider,
FunctionController: FunctionController,
ColorController: ColorController
},
dom: {
dom: dom
},
gui: {
GUI: GUI
},
GUI: GUI
}; };