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
var webpack = require('webpack'); | |
module.exports = { | |
entry: './index', | |
output: { | |
path: __dirname + '/public', | |
publicPath: '/public/', | |
filename: 'bundle.js' | |
}, | |
module: { |
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 riot from 'riot'; | |
import tag from './tags/header.tag'; | |
//function to load routes from primary chunk | |
function loadPrimaryChunk(){ | |
return new Promise((resolve,reject)=>{ | |
//this line ensures cart and co tags are bundled into one file | |
require.ensure(['./tags/home.tag'], (require) => { | |
require('./tags/home.tag'); | |
resolve(); |
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
<app-route> | |
<router show-routes={true} on-routechange={fireRouteChange} on-tagnotfound={fireTagnotfound}> | |
<route path='/' component='home'></route> | |
<route path='user'> | |
<route path='/profile/:user' component='user-component'></route> | |
</route> | |
<route path='messages'> | |
<route path='/outbox' component='msg-outbox'></route> | |
<route path='/:from-:to' component='{prplFunc}'></route> | |
</route> |
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
var CommonsPlugin = new require("webpack/lib/optimize/CommonsChunkPlugin"); | |
var webpack = new require("webpack"); | |
module.exports = { | |
entry: { | |
home: "./scripts/home.js", | |
apis: "./scripts/api.js", | |
app: "./scripts/app.js", | |
vendor: "./scripts/vendor.js" | |
}, |
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
<rtr-router> | |
<router> | |
<route path ='/' component="rtr-home"/> | |
<route path ='/apis' component={this.parent.loadApiPage}/> | |
<route path ='/isomorphism' component="rtr-isomorphism"/> | |
<route path ='/prpl' component={this.parent.loadPrplPage}/> | |
</router> | |
<script> | |
this.loadApiPage = function(){ | |
return new Promise((resolve,reject)=>{ |
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
var riot = require("riot"); | |
require("./tags/*.tag"); | |
console.log(riot.render('app-router'),{location:req.url}); | |
/* | |
* location: param passed to router to select which route to render | |
*/ |
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
{ | |
"name": "riotcodesplit", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", |
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
var webpack = require('webpack'); | |
module.exports = { | |
entry: './index', | |
output: { | |
path: __dirname + '/public', | |
publicPath: '/public/', | |
filename: 'bundle.js' | |
}, | |
module: { |
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
var webpack = require('webpack'); | |
var path = require("path"); | |
var CommonsPlugin = new require("webpack/lib/optimize/CommonsChunkPlugin"); | |
var VendorChunkPlugin = require('webpack-vendor-chunk-plugin'); | |
module.exports = { | |
entry: { | |
home: './home.js', | |
browse: './browse.js', | |
product: './product.js', |
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
var webpack = require('webpack'); | |
var path = require("path"); | |
var CommonsPlugin = new require("webpack/lib/optimize/CommonsChunkPlugin"); | |
var VendorChunkPlugin = require('webpack-vendor-chunk-plugin'); | |
module.exports = { | |
entry: { | |
app:'./app.js', | |
vendor: './vendor.js' | |
}, |
OlderNewer