This repository has been archived by the owner on Oct 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
127 additions
and
117 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,26 +1,20 @@ | ||
{ | ||
"stage": 0, | ||
"optional": "runtime", | ||
"loose": "all", | ||
"presets": [ | ||
"es2015", | ||
"stage-0", | ||
"react" | ||
], | ||
"plugins": [ | ||
"typecheck" | ||
[ "transform-runtime" ], | ||
[ "typecheck" ], | ||
[ "transform-decorators-legacy" ] | ||
], | ||
"env": { | ||
"development": { | ||
"plugins": [ | ||
"react-transform" | ||
], | ||
"extra": { | ||
"react-transform": { | ||
"transforms": [{ | ||
"transform": "react-transform-catch-errors", | ||
"imports": [ | ||
"react", | ||
"redbox-react" | ||
] | ||
}] | ||
} | ||
} | ||
"plugins": [] | ||
}, | ||
"production": { | ||
"plugins": [] | ||
} | ||
} | ||
} |
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
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,72 @@ | ||
var fs = require('fs'); | ||
var strip = require('strip-loader'); | ||
var path = require('path'); | ||
var util = require('util'); | ||
|
||
module.exports = function(userBabelConfig, verbose) { | ||
|
||
var babelrc = fs.readFileSync(path.resolve(__dirname, '..', './.babelrc')); | ||
var babelConfig = {}; | ||
var jsLoaders; | ||
|
||
try { | ||
babelConfig = JSON.parse(babelrc); | ||
} catch (err) { | ||
console.error('==> ERROR: Error parsing your .babelrc.'); | ||
console.error(err); | ||
} | ||
|
||
if(userBabelConfig) { | ||
console.log('Merging universal-redux Babel defaults with project Babel configuration'); | ||
|
||
var userBabelConfigFile = fs.readFileSync(path.resolve(userBabelConfig)); | ||
var userBabelConfig = {}; | ||
|
||
try { | ||
userBabelConfig = JSON.parse(userBabelConfigFile); | ||
} catch (err) { | ||
console.error('==> ERROR: Error parsing your project-level Babel configuration.'); | ||
console.error(err); | ||
} | ||
|
||
babelConfig = Object.assign(babelConfig, userBabelConfig); | ||
} | ||
|
||
if (process.env.NODE_ENV !== 'production') { | ||
|
||
var hmrConfig = [ | ||
"react-transform", { | ||
"transforms": [ | ||
{ | ||
"transform": "react-transform-hmr", | ||
"imports": ["react"], | ||
"locals": ["module"] | ||
}, | ||
{ | ||
"transform": "react-transform-catch-errors", | ||
"imports": ["react", "redbox-react"] | ||
} | ||
] | ||
} | ||
] | ||
|
||
babelConfig.env.development.plugins.unshift(hmrConfig); | ||
|
||
jsLoaders = ['babel-loader?' + JSON.stringify(babelConfig)]; | ||
} else { | ||
jsLoaders = [strip.loader('debug'), 'babel-loader?' + JSON.stringify(babelConfig)]; | ||
} | ||
|
||
// output configuration files if user wants verbosity | ||
if(verbose) { | ||
var utilOptions = { | ||
depth: 10, | ||
colors: true | ||
}; | ||
|
||
console.log('Babel config:'); | ||
console.log(util.inspect(babelConfig, utilOptions)); | ||
} | ||
|
||
return jsLoaders; | ||
} |
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
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
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 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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"description": "A universal redux renderer (ES6, Webpack, Express)", | ||
"author": "Buck DeFore <[email protected]> (http://github.com/bdefore)", | ||
"license": "MIT", | ||
"version": "1.0.0", | ||
"version": "2.0.0-beta3", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/bdefore/universal-redux.git" | ||
|
@@ -25,21 +25,27 @@ | |
], | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"compile": "babel src/ -d lib/", | ||
"compile": "babel --presets es2015,stage-0,react --plugins transform-runtime src/ --out-dir lib/", | ||
"dev": "./bin/local-dev.sh", | ||
"prepublish": "npm run compile", | ||
"lint": "eslint -c .eslintrc src", | ||
"test": "karma start" | ||
}, | ||
"dependencies": { | ||
"autoprefixer-loader": "^3.1.0", | ||
"babel": "~5.8.29", | ||
"babel-core": "~5.8.33", | ||
"babel-eslint": "^4.1.3", | ||
"babel-loader": "~5.3.3", | ||
"babel-plugin-react-transform": "~1.1.1", | ||
"babel-plugin-typecheck": "^2.0.0", | ||
"babel-runtime": "~5.8.29", | ||
"babel": "~6.3.13", | ||
"babel-cli": "6.3.17", | ||
"babel-core": "~6.3.21", | ||
"babel-eslint": "^5.0.0-beta3", | ||
"babel-loader": "~6.2.0", | ||
"babel-plugin-react-transform": "~2.0.0-beta1", | ||
"babel-plugin-transform-decorators-legacy": "^1.3.4", | ||
"babel-plugin-transform-runtime": "^6.3.13", | ||
"babel-plugin-typecheck": "^3.5.1", | ||
"babel-preset-es2015": "^6.3.13", | ||
"babel-preset-react": "^6.3.13", | ||
"babel-preset-stage-0": "^6.3.13", | ||
"babel-runtime": "~6.3.19", | ||
"bootstrap-sass": "^3.3.5", | ||
"bootstrap-sass-loader": "^1.0.9", | ||
"clean-webpack-plugin": "^0.1.4", | ||
|
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.