Difference between revisions of "Tooling"

From Wiki2
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
== tooling ==
== tooling tips==
 
* http://moduscreate.com/optimizing-react-es6-webpack-production-build/
* https://github.com/babel/example-node-server
* https://medium.com/@rajaraodv/webpack-the-confusing-parts-58712f8fcad9#.2rjiycn50


<markdown>
<markdown>
### ~8/10/16 wamp/www/sbdev0/geniot/client/hrs/client -> iot.sitebuilt.net/xtest
running in windows "start": "set NODE_ENV=development&& nodemon lib/index.js --exec babel-node --presets es2015,stage-2 --watch lib" you get
    Unverified.js:63 Uncaught TypeError: _pushPath is not a function
## webpack dev server
* DOES NOT WORK in updating the bundle if index.html is outside of /dist. Keep yout index.html inside your /dist folder
* needs this for history api
    devServer: {
      historyApiFallback: true
    },
### windows package.json quirks
    "deploy": "NODE_ENV=production webpack -p --config webpack.production.config.js",
    "deploy": "set NODE_ENV=production&& webpack -p --config webpack.production.config.js",
### react-babel
### react-babel


Line 11: Line 35:
     touch index.html
     touch index.html


### ulidog
### public/index.html


<!DOCTYPE html>
<!DOCTYPE html>
Line 19: Line 43:
</head>
</head>
<body>
<body>
 
<div id="app"></div>
<script src="bundle.js"></script>
</body>
</body>
</html>
</html>
### webpack.config.js
module.exports = {
entry: "./app/components/Main.js",
output: {
filename: "public/bundle.js"
},
module: {
loaders: [
{
test: /\\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel'
}
]
}
};


</markdown>
</markdown>
===webpack===
*https://github.com/ruanyf/webpack-demos#demo14-exposing-global-variables-source

Latest revision as of 17:18, 29 September 2016

tooling tips

<markdown>

      1. ~8/10/16 wamp/www/sbdev0/geniot/client/hrs/client -> iot.sitebuilt.net/xtest

running in windows "start": "set NODE_ENV=development&& nodemon lib/index.js --exec babel-node --presets es2015,stage-2 --watch lib" you get

    Unverified.js:63 Uncaught TypeError: _pushPath is not a function


    1. webpack dev server
  • DOES NOT WORK in updating the bundle if index.html is outside of /dist. Keep yout index.html inside your /dist folder
  • needs this for history api
    devServer: {
      historyApiFallback: true
    },
      1. windows package.json quirks
    "deploy": "NODE_ENV=production webpack -p --config webpack.production.config.js",
    "deploy": "set NODE_ENV=production&& webpack -p --config webpack.production.config.js",
      1. react-babel
   npm init
   npm install --save react
   npm install --save-dev babel-loader
   mkdir public
   cd public
   touch index.html
      1. public/index.html

<!DOCTYPE html>

      1. webpack.config.js

module.exports = { entry: "./app/components/Main.js", output: { filename: "public/bundle.js" }, module: { loaders: [ { test: /\\.jsx?$/, exclude: /(node_modules|bower_components)/, loader: 'babel' } ] } };

</markdown>

webpack