forked from Hacker0x01/react-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added module entry point - refactored build process, removed grunt in…
… favor of npm scripts (Hacker0x01#1115)
- Loading branch information
1 parent
ebc6109
commit d28aa97
Showing
17 changed files
with
1,300 additions
and
1,130 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,18 +1,3 @@ | ||
{ | ||
"presets": ["es2015", "stage-0", "react"], | ||
"env": { | ||
"development": { | ||
"plugins": [ | ||
"transform-class-properties", | ||
["react-transform", { | ||
"transforms": [{ | ||
"transform": "react-transform-hmr", | ||
"imports": ["react"], | ||
"locals": ["module"] | ||
}] | ||
}], | ||
"add-react-displayname" | ||
] | ||
} | ||
} | ||
"presets": ["./.babelrc.js"] | ||
} |
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,29 @@ | ||
var NODE_ENV = process.env.NODE_ENV | ||
var MODULES = process.env.MODULES | ||
|
||
var modules = MODULES === 'false' || NODE_ENV === 'test' ? 'commonjs' : false | ||
|
||
var config = { | ||
presets: [['env', { | ||
loose: true, | ||
modules: modules, | ||
forceAllTransforms: NODE_ENV === 'production' | ||
}], 'stage-0', 'react'], | ||
plugins: [] | ||
} | ||
|
||
if (NODE_ENV === 'development') { | ||
config.plugins = config.plugins.concat([ | ||
'transform-class-properties', | ||
['react-transform', { | ||
transforms: [{ | ||
transform: 'react-transform-hmr', | ||
imports: ['react'], | ||
locals: ['module'] | ||
}] | ||
}], | ||
'add-react-displayname' | ||
]) | ||
} | ||
|
||
module.exports = config |
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ npm-debug.log | |
.vscode | ||
dist | ||
lib | ||
es | ||
tmp | ||
coverage | ||
docs-site/bundle.js | ||
|
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 |
---|---|---|
|
@@ -10,4 +10,4 @@ dependencies: | |
|
||
test: | ||
override: | ||
- yarn test | ||
- yarn check |
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
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,26 @@ | ||
import nodeResolve from 'rollup-plugin-node-resolve' | ||
import babel from 'rollup-plugin-babel' | ||
import commonjs from 'rollup-plugin-commonjs' | ||
import { list as babelHelpersList } from 'babel-helpers' | ||
import pkg from './package.json' | ||
|
||
const config = { | ||
output: { | ||
format: process.env.BABEL_ENV | ||
}, | ||
plugins: [ | ||
nodeResolve({ | ||
jsnext: true, | ||
extensions: ['.js', '.jsx'] | ||
}), | ||
babel({ | ||
exclude: 'node_modules/**', | ||
plugins: ['external-helpers'], | ||
externalHelpersWhitelist: babelHelpersList.filter(helperName => helperName !== 'asyncGenerator') | ||
}), | ||
commonjs() | ||
], | ||
external: Object.keys(pkg.dependencies).concat(Object.keys(pkg.peerDependencies)) | ||
} | ||
|
||
export default config |
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,34 @@ | ||
import config from './rollup.config.js' | ||
import uglify from 'rollup-plugin-uglify' | ||
|
||
const env = process.env.NODE_ENV | ||
|
||
const umdConfig = Object.assign({}, config, { | ||
output: Object.assign({}, config.output, { | ||
format: 'umd', | ||
name: 'DatePicker' | ||
}), | ||
globals: { | ||
react: 'React', | ||
'prop-types': 'PropTypes', | ||
'react-onclickoutside': 'onClickOutside', | ||
'react-popper': 'ReactPopper', | ||
'moment': 'moment', | ||
'classnames': 'classNames' | ||
} | ||
}) | ||
|
||
if (env === 'production') { | ||
config.plugins.push( | ||
uglify({ | ||
compress: { | ||
pure_getters: true, | ||
unsafe: true, | ||
unsafe_comps: true, | ||
warnings: false | ||
} | ||
}) | ||
) | ||
} | ||
|
||
export default umdConfig |
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
Oops, something went wrong.