Skip to content

Commit

Permalink
Merge pull request #14 from xx45/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
iamkun committed Apr 12, 2018
2 parents 881f6b6 + c14f024 commit fb1fc27
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 6 deletions.
23 changes: 20 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
{
"presets": [
"@babel/preset-env"
]
"env": {
"test": {
"presets": [
"@babel/preset-env"
]
},
"build": {
"presets": [
[
"@babel/preset-env",
{
"modules": false
}
]
],
"plugins": [
"external-helpers"
]
}
}
}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ yarn.lock
package-lock.json

# jest
coverage
coverage

# dist
dist
13 changes: 13 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# OSX
.DS_Store

# IDE
.idea

# npm
node_modules
yarn.lock
package-lock.json

# jest
coverage
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ script:
- codecov
after_success:
- if [ "$TRAVIS_BRANCH" == "master" ]; then
npm run build;
nvm install v8.10.0 && nvm use v8.10.0;
npm install -g travis-deploy-once semantic-release;
travis-deploy-once "semantic-release";
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "src/index.js",
"scripts": {
"test": "jest",
"lint": "echo start lint && ./node_modules/.bin/eslint src/* test/*"
"lint": "echo start lint && ./node_modules/.bin/eslint src/* test/*",
"build": "rollup -c"
},
"pre-commit": [
"lint"
Expand All @@ -27,12 +28,16 @@
"@babel/preset-env": "^7.0.0-beta.44",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^22.4.3",
"babel-plugin-external-helpers": "^6.22.0",
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.10.0",
"eslint-plugin-jest": "^21.15.0",
"jest": "^22.4.3",
"moment": "^2.22.0",
"pre-commit": "^1.2.2"
"pre-commit": "^1.2.2",
"rollup": "^0.57.1",
"rollup-plugin-babel": "^4.0.0-beta.4",
"rollup-plugin-uglify": "^3.0.0"
}
}
17 changes: 17 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import babel from 'rollup-plugin-babel'
import uglify from 'rollup-plugin-uglify'

export default {
input: 'src/index.js',
output: {
file: 'dist/index.js',
format: 'umd',
name: 'dayjs'
},
plugins: [
babel({
exclude: 'node_modules/**'
}),
uglify()
]
};

0 comments on commit fb1fc27

Please sign in to comment.