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
import React from 'react'; | |
const Greeter = ({name,place}) => ( | |
<h1>Hello,{name}. Welcome to the {place}.</h1> | |
); | |
export default Greeter; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="x-ua-compatible" content="ie=edge"> | |
<title>Simple Webpack Configuration</title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> |
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
module.exports = { | |
entry:'./app.js', | |
output:{ | |
filename:'bundle.js', | |
path:'./build' | |
}, | |
module:{ | |
loaders:[ | |
{ | |
test:/\.scss$/, |
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
require('expose?gapiCallback!./google-client-code'); | |
require('expose?gmapsCallback!./google-maps-code'); | |
$script('https://maps.googleapis.com/maps/api/js?onload=window.gapiCallback','google-maps'); | |
$script('https://apis.google.com/js/client.js?callback=window.gmapsCallback','google-api'); |
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
module.exports = { | |
entry:'./app.js', | |
output:{ | |
filename:'bundle.js', | |
path:'./build' | |
}, | |
devServer:{ | |
stats:'errors-only', | |
contentBase:'./build', | |
inline:true, |
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
"scripts": { | |
"lint": "eslint . ./test", | |
"build": "cross-env NODE_ENV=dev webpack", | |
"build:server": "cross-env NODE_ENV=dev webpack-dev-server", | |
"test": "cross-env NODE_ENV=test karma start" | |
} |
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
npm install webpack webpack-merge webpack-dev-server babel babel-preset-es2015 babel-preset-react babel-polyfill babel-transform-react-transform react-transform-catch-errors react-transform-hmr babel-loader style-loader css-loader sass-loader url-loader |
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
npm install webpack webpack-merge webpack-dev-server babel babel-loader babel-plugin-react-transform react-transform-hmr react-transform-catch-errors babel-eslint eslint eslint-plugin-react mocha chai enzyme chai-enzyme phnatomjs-prebuilt karma karma-webpack karma-mocha karma-phantomjs-launcher karma-chai karma-sourcemap-loader react-addons-test-utils |
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
module.exports = { | |
entry:’./app.js’, | |
output:{ | |
filename:’bundle.js’, | |
path:’./build’ | |
}, | |
module:{ | |
loaders:[ | |
{ | |
test:regexp_here, |
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
{ | |
module: { | |
loaders: [ | |
{ test: /underscore/, loader: 'exports?_' } | |
{ test: /backbone/, | |
loader: 'exports?Backbone!imports?underscore=underscore&jquery=jquery' | |
} | |
] | |
} | |
} |
OlderNewer