Skip to content

Commit

Permalink
Merge pull request #17 from jaebradley/update-package
Browse files Browse the repository at this point in the history
Update package
  • Loading branch information
jaebradley authored Apr 24, 2018
2 parents 8d80f8d + bc656c1 commit f6cca26
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/mergeContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const mergeContent = ({ originalContent, additionalContent }) => {
return JSON.stringify(mergedContent, null, 2);
}

return `${originalContent}\n${additionalContent}`.trim();
return `${originalContent}\n${additionalContent}`.trimLeft();
};

export default mergeContent;
13 changes: 8 additions & 5 deletions src/templates/core/package.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@
"rollup-plugin-commonjs": "^9.1.0",
"rollup-plugin-filesize": "^1.5.0",
"rollup-plugin-local-resolve": "^1.0.7",
"rollup-plugin-node-resolve": "^3.3.0"
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-uglify":"^3.0.0"
},
"testPathIgnorePatterns": [
"<rootDir>/build/",
"<rootDir>/node_modules/"
]
"jest": {
"testPathIgnorePatterns": [
"<rootDir>/build/",
"<rootDir>/node_modules/"
]
}
}
4 changes: 4 additions & 0 deletions src/templates/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
},
"jest": {
"testEnvironment": "node"
},
"devDependencies": {
"rollup-plugin-node-globals": "^1.2.0",
"rollup-plugin-node-builtins": "^2.1.2"
}
}
21 changes: 17 additions & 4 deletions src/templates/node/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,43 @@ import resolve from 'rollup-plugin-node-resolve';
import localResolve from 'rollup-plugin-local-resolve';
import filesize from 'rollup-plugin-filesize';
import minify from 'rollup-plugin-babel-minify';
import globals from 'rollup-plugin-node-globals';
import builtins from 'rollup-plugin-node-builtins';
import uglify from 'rollup-plugin-uglify';

const config = {
input: 'src/index.js',
output: [
{
file: 'build/index.js',
format: 'umd',
name: "{{packageName}}",
name: '{{packageName}}',
},
{
file: 'build/index.cjs.js',
format: 'cjs',
name: "{{packageName}}",
name: '{{packageName}}',
},
{
file: 'build/index.esm.js',
format: 'es',
},
],
plugins: [
globals(),
builtins(),
babel({ exclude: 'node_modules/**' }),
minify(),
localResolve(),
resolve(),
resolve({
module: true,
jsnext: true,
main: true,
preferBuiltins: true,
browser: true,
modulesOnly: true,
}),
minify(),
uglify(),
commonjs(),
filesize(),
],
Expand Down
15 changes: 6 additions & 9 deletions src/templates/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
"lint": "eslint --ext .js,.jsx .",
"storybook": "start-storybook -p 6006"
},
"dependencies": {
"prop-types": "^15.6.1",
"react": "^16.3.1",
"react-dom": "^16.3.1"
},
"dependencies": {},
"devDependencies": {
"@babel/preset-react": "^7.0.0-beta.44",
"@storybook/addon-a11y": "^3.4.1",
Expand All @@ -26,6 +22,9 @@
"identity-obj-proxy": "^3.0.0",
"node-sass": "^4.8.3",
"postcss": "^6.0.21",
"prop-types": "^15.6.1",
"react": "^16.3.1",
"react-dom": "^16.3.1",
"rollup-plugin-peer-deps-external": "^2.1.0",
"rollup-plugin-postcss": "^1.5.1",
"sass-loader": "^6.0.7",
Expand All @@ -52,10 +51,8 @@
"src/**/*.{js,jsx}"
],
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"testPathIgnorePatterns": [
"*.stories.{js,jsx}"
"/node_modules/",
"(.stories)\\.(jsx)$"
]
}
}
9 changes: 6 additions & 3 deletions src/templates/react/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ import postcss from 'rollup-plugin-postcss';
import filesize from 'rollup-plugin-filesize';
import autoprefixer from 'autoprefixer';
import localResolve from 'rollup-plugin-local-resolve';

import uglify from 'rollup-plugin-uglify';
import minify from 'rollup-plugin-babel-minify';

const config = {
input: 'src/index.js',
output: [
{
file: 'build/index.js',
format: 'umd',
name: "{{packageName}}",
name: '{{packageName}}',
globals: {
react: 'React',
'prop-types': 'PropTypes',
Expand All @@ -23,7 +24,7 @@ const config = {
{
file: 'build/index.cjs.js',
format: 'cjs',
name: "{{packageName}}",
name: '{{packageName}}',
},
{
file: 'build/index.esm.js',
Expand All @@ -42,6 +43,8 @@ const config = {
localResolve(),
resolve(),
commonjs(),
minify(),
uglify(),
filesize(),
],
};
Expand Down

0 comments on commit f6cca26

Please sign in to comment.