Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
Fixed (in boilerplate): collection cache can now be used for static r…
Browse files Browse the repository at this point in the history
…endering
  • Loading branch information
MoOx committed Nov 4, 2015
1 parent ffc4401 commit 9b475a3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions demo/scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import fs from "fs"
import path from "path"
import webpack from "webpack"
import ExtractTextPlugin from "extract-text-webpack-plugin"
Expand Down Expand Up @@ -180,6 +181,11 @@ builder({

target: "node",

externals: [
...fs.readdirSync("node_modules").filter((x) => x !== ".bin"),
"statinamic/lib/md-collection-loader/cache",
],

output: {
...webpackConfig.output,
libraryTarget: "commonjs2",
Expand Down
4 changes: 3 additions & 1 deletion demo/web_modules/app/store.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { combineReducers } from "redux"
import createStore from "statinamic/lib/redux/createStore"
import * as statinamicReducers from "statinamic/lib/redux/modules"
import minifyCollection from "statinamic/lib/md-collection-loader/minify"

import * as pageComponents from "app/pageComponents"

Expand All @@ -14,10 +15,11 @@ const store = createStore(
// static build optimization
...__PROD__ && {
collection:
require("statinamic/lib/md-collection-loader/cache").default,
minifyCollection(require("statinamic/lib/md-collection-loader/cache")),
},

pageComponents,
}
)

export default store
6 changes: 6 additions & 0 deletions src/boilerplate/scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import fs from "fs"
import path from "path"
import webpack from "webpack"
import ExtractTextPlugin from "extract-text-webpack-plugin"
Expand Down Expand Up @@ -177,6 +178,11 @@ builder({

target: "node",

externals: [
...fs.readdirSync("node_modules").filter((x) => x !== ".bin"),
"statinamic/lib/md-collection-loader/cache",
],

output: {
...webpackConfig.output,
libraryTarget: "commonjs2",
Expand Down
4 changes: 3 additions & 1 deletion src/boilerplate/web_modules/app/store.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { combineReducers } from "redux"
import createStore from "statinamic/lib/redux/createStore"
import * as statinamicReducers from "statinamic/lib/redux/modules"
import minifyCollection from "statinamic/lib/md-collection-loader/minify"

import * as pageComponents from "app/pageComponents"

Expand All @@ -14,10 +15,11 @@ const store = createStore(
// static build optimization
...__PROD__ && {
collection:
require("statinamic/lib/md-collection-loader/cache").default,
minifyCollection(require("statinamic/lib/md-collection-loader/cache")),
},

pageComponents,
}
)

export default store

0 comments on commit 9b475a3

Please sign in to comment.