Skip to content

Commit

Permalink
refactor build
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbarbara committed Dec 5, 2017
1 parent e4408d1 commit 65d53b3
Show file tree
Hide file tree
Showing 11 changed files with 873 additions and 1,395 deletions.
32 changes: 26 additions & 6 deletions .babelrc
@@ -1,14 +1,34 @@
{
"presets": [
["env", {
[
"env", {
"useBuiltIns": true,
"modules": false,
"targets": {
"browsers": ["last 2 versions", "safari >= 7"]
"node": "8"
}
}],
}
],
"react",
"stage-1"
],
"plugins": [
"add-module-exports"
]
"env": {
"production": {
"plugins": [
"array-includes",
"transform-flow-strip-types"
]
},
"commonjs": {
"plugins": [
["transform-es2015-modules-commonjs", { "loose": true }]
]
},
"test": {
"plugins": [
"transform-es2015-modules-commonjs"
],
"sourceMaps": "both"
}
}
}
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,8 +1,9 @@
.idea/
.tmp/
coverage/
dist/
es/
documentation/
lib/

This comment has been minimized.

Copy link
@crohrer

crohrer Dec 5, 2017

this seems to cause Can't resolve 'react-inlinesvg'

This comment has been minimized.

Copy link
@gilbarbara

gilbarbara Dec 5, 2017

Author Owner

Nope.
NPM wasn't copying the required directories. I needed to add these to package.json

{
...
"module": "es/index.js",
"files": [
  "es",
  "lib",
  "src"
],
...
}
node_modules/
reports/
selenium-debug.log
Expand Down
11 changes: 0 additions & 11 deletions .npmignore

This file was deleted.

7 changes: 4 additions & 3 deletions bower.json
Expand Up @@ -10,18 +10,19 @@
"keywords": [
"react-component",
"react",
"svg",
"component"
"component",
"svg"
],
"license": "MIT",
"homepage": "https://github.com/matthewwithanm/react-inlinesvg",
"ignore": [
"**/.*",
"coverage",
"es",
"gulpfile.js",
"lib",
"jest.config.js",
"node_modules",
"lib",
"test"
]
}
16 changes: 2 additions & 14 deletions gulpfile.js
Expand Up @@ -23,20 +23,10 @@ gulp.task('bump:patch', function() {
return bump('patch');
});

gulp.task('watch', function() {
gulp.watch('./src/**/*', ['build']);
});

gulp.task('build:node', function() {
gulp.task('build', function() {
process.env.NODE_ENV = 'production';
process.env.BABEL_ENV = 'commonjs';

return gulp.src('./src/**/*.js')
.pipe($.babel({}))
.pipe(gulp.dest('./lib'));
});

gulp.task('build:browser', function() {
process.env.NODE_ENV = 'production';
var bundler;
var stream;

Expand Down Expand Up @@ -75,5 +65,3 @@ gulp.task('server:xdomain', function() {
}
});
});

gulp.task('build', ['build:node', 'build:browser']);
281 changes: 0 additions & 281 deletions lib/index.js

This file was deleted.

0 comments on commit 65d53b3

Please sign in to comment.