Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ before_script:
# give mongo time to come up
- sleep 15

before_script:
- npm prune

script:
- npm run lint
- npm run flow
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Crater

[![Build Status](https://travis-ci.org/jcoreio/crater.svg?branch=master)](https://travis-ci.org/jcoreio/crater)
[![Coverage Status](https://coveralls.io/repos/github/jcoreio/crater/badge.svg?branch=master)](https://coveralls.io/github/jcoreio/crater?branch=master)
[![Build Status](https://travis-ci.org/jcoreio/crater.svg?branch=webpack2)](https://travis-ci.org/jcoreio/crater)
[![Coverage Status](https://coveralls.io/repos/github/jcoreio/crater/badge.svg?branch=webpack2)](https://coveralls.io/github/jcoreio/crater?branch=webpack2)

## A new app skeleton for Meteor/React

Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
},
"dependencies": {
"babel-plugin-module-resolver": "^2.7.1",
"babel-runtime": "^6.23.0",
"bcrypt": "^1.0.1",
"debug": "^2.5.2",
"es6-promisify": "^5.0.0",
"express": "^4.14.0",
"fibers": "^1.0.15",
"immutable": "^3.8.1",
"json-string-loader": "1.0.0",
"meteor-node-stubs": "^0.2.4",
"prop-types": "^15.5.10",
"react": "^15.4.0",
Expand All @@ -49,7 +49,7 @@
"redux": "^3.5.2",
"redux-immutablejs": "0.0.8"
},
"version": "2.0.0",
"version": "2.0.0-alpha.0",
"main": "index.js",
"author": "Andy Edwards <jedwards@fastmail.com>",
"license": "ISC",
Expand All @@ -70,7 +70,6 @@
"babel-preset-react": "^6.11.1",
"babel-preset-stage-1": "^6.13.0",
"babel-register": "^6.14.0",
"babel-runtime": "^6.23.0",
"chai": "^3.5.0",
"coveralls": "^2.11.15",
"crater-util": "^1.2.2",
Expand All @@ -84,22 +83,23 @@
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-react": "^6.7.1",
"eslint-watch": "^3.0.0",
"extract-text-webpack-plugin": "^1.0.1",
"extract-text-webpack-plugin": "^2.1.0",
"fake-style-loader": "^1.0.1",
"file-loader": "^0.9.0",
"flow-bin": "^0.42.0",
"flow-watch": "^1.0.0",
"glob": "^7.0.6",
"happypack": "^3.0.0",
"happypack": "^3.0.3",
"http-proxy": "^1.14.0",
"istanbul": "^0.4.5",
"json-loader": "^0.5.4",
"meteor-imports-webpack-plugin": "^1.1.5",
"json-string-loader": "^1.1.0",
"meteor-imports-webpack-plugin": "^2.0.4",
"mkdirp": "^0.5.1",
"mocha": "^3.0.2",
"node-inspector": "^0.12.8",
"nyc": "^10.0.0",
"phantomjs-prebuilt": "2.1.4",
"phantomjs-prebuilt": "2.1.12",
"popsicle": "^9.0.0",
"postcss-loader": "^1.1.1",
"postcss-modules-values": "^1.2.2",
Expand All @@ -113,9 +113,9 @@
"style-loader": "^0.13.1",
"url-loader": "^0.5.7",
"webdriverio": "^4.4.0",
"webpack": "^1.14.0",
"webpack-dev-middleware": "^1.6.1",
"webpack-hot-middleware": "^2.13.2",
"webpack": "^2.3.2",
"webpack-dev-middleware": "^1.7.0",
"webpack-hot-middleware": "^2.12.2",
"webpack-node-externals": "^1.3.3"
},
"repository": {
Expand Down
1 change: 1 addition & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
// required by PostCSS
module.exports = {}

2 changes: 2 additions & 0 deletions src/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { Map as iMap } from 'immutable'
import makeStore from '../universal/redux/makeStore'
import Root from './Root'

if (process.env.NODE_ENV !== 'production') require('es6-promise').polyfill()

Meteor.startup(() => {
const { router } = window.__INITIAL_STATE__

Expand Down
74 changes: 53 additions & 21 deletions webpack/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ const srcDir = path.join(root, 'src')
const globalCSS = path.join(srcDir, 'styles', 'global')
const clientInclude = [srcDir]

const meteorConfig = {
meteorProgramsFolder: path.resolve(BUILD_DIR, 'meteor', 'bundle', 'programs'),
injectMeteorRuntimeConfig: false,
exclude: [],
}

const config = {
context: root,
entry: [
Expand All @@ -35,7 +41,7 @@ const config = {
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.DefinePlugin({
'__CLIENT__': true,
'__PRODUCTION__': false,
Expand All @@ -46,41 +52,67 @@ const config = {
'process.env.NODE_ENV': JSON.stringify('development'),
}),
new HappyPack({
id: '1', // https://github.com/amireh/happypack/issues/88
loaders: [{
path: 'babel',
query: {
'plugins': [
'react-hot-loader/babel',
path: 'babel-loader',
options: {
"presets": [["es2015", {loose: true, modules: false}], "stage-1", "react", "flow"],
"plugins": [
"transform-runtime",
"react-hot-loader/babel",
],
},
"env": {
"coverage": {
"plugins": [
"istanbul"
]
}
}
}
}],
threads: 4,
}),
new MeteorImportsPlugin({
meteorProgramsFolder: path.resolve(BUILD_DIR, 'meteor', 'bundle', 'programs'),
injectMeteorRuntimeConfig: false,
new webpack.LoaderOptionsPlugin({
options: {
postcss: [cssModulesValues]
}
}),
new MeteorImportsPlugin(meteorConfig),
],
postcss: [cssModulesValues],
module: {
loaders: [
{ test: /\.json$/, loader: 'json-loader', exclude: [
path.join(root, 'node_modules', 'meteor-imports-webpack-plugin'),
path.join(root, 'build', 'meteor', 'bundle', 'programs'),
]},
{ test: /\.txt$/, loader: 'raw-loader' },
{ test: /\.(png|jpg|jpeg|gif|svg|woff|woff2)$/, loader: 'url-loader?limit=10000' },
{ test: /\.(eot|ttf|wav|mp3)$/, loader: 'file-loader' },
rules: [
{
test: /\.json$/,
loader: 'json-loader',
exclude: [
path.join(root, 'build', 'meteor', 'bundle', 'programs'),
]
},
{test: /\.txt$/, loader: 'raw-loader'},
{
test: /\.(png|jpg|jpeg|gif|svg|woff|woff2)$/,
use: [{loader: 'url-loader', options: {limit: 10000}}]
},
{test: /\.(eot|ttf|wav|mp3)$/, loader: 'file-loader'},
{
test: /\.css$/,
loader: 'style!css?modules&importLoaders=1&localIdentName=[name]_[local]_[hash:base64:5]!postcss',
use: [
{loader: 'style-loader'},
{
loader: 'css-loader',
options: {
modules: true,
importLoaders: 1,
localIdentName: '[name]_[local]_[hash:base64:5]'
}
},
{loader: 'postcss-loader'},
],
exclude: globalCSS,
include: clientInclude,
},
{
test: /\.css$/,
loader: 'style!css',
use: [{loader: 'style-loader'}, {loader: 'css-loader'}],
include: globalCSS,
},
{
Expand Down
75 changes: 56 additions & 19 deletions webpack/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ const srcDir = path.resolve(root, 'src')
const globalCSS = path.join(srcDir, 'styles', 'global')
const clientInclude = [srcDir]

const meteorConfig = {
meteorProgramsFolder: path.resolve(BUILD_DIR, 'meteor', 'bundle', 'programs'),
injectMeteorRuntimeConfig: false,
exclude: [],
}

const vendor = [
'react',
'react-dom',
Expand Down Expand Up @@ -46,9 +52,9 @@ const config = {
chunks: ['meteor']
}),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.optimize.MinChunkSizePlugin({ minChunkSize: 50000 }),
new webpack.NoErrorsPlugin(),
new AssetsPlugin({ path: BUILD_DIR, filename: 'assets.json' }),
new webpack.optimize.MinChunkSizePlugin({minChunkSize: 50000}),
new webpack.NoEmitOnErrorsPlugin(),
new AssetsPlugin({path: BUILD_DIR, filename: 'assets.json'}),
new webpack.DefinePlugin({
'__CLIENT__': true,
'Meteor.isClient': true,
Expand All @@ -59,35 +65,66 @@ const config = {
}),
new webpack.IgnorePlugin(/\/server\//),
new HappyPack({
id: '1', // https://github.com/amireh/happypack/issues/88
cache: false,
loaders: ['babel'],
loaders: [{
path: 'babel-loader',
options: {
"presets": [["es2015", {loose: true, modules: false}], "stage-1", "react", "flow"],
"plugins": [
"transform-runtime",
],
"env": {
"coverage": {
"plugins": [
"istanbul"
]
}
}
}
}],
threads: 4,
}),
new MeteorImportsPlugin({
meteorProgramsFolder: path.resolve(BUILD_DIR, 'meteor', 'bundle', 'programs'),
injectMeteorRuntimeConfig: false,
new webpack.LoaderOptionsPlugin({
minimize: true,
options: {
postcss: [cssModulesValues]
}
}),
new MeteorImportsPlugin(meteorConfig),

],
postcss: [cssModulesValues],
module: {
loaders: [
{ test: /\.json$/, loader: 'json-loader', exclude: [
path.join(root, 'node_modules', 'meteor-imports-webpack-plugin'),
path.join(root, 'build', 'meteor', 'bundle', 'programs'),
]},
{ test: /\.txt$/, loader: 'raw-loader' },
{ test: /\.(png|jpg|jpeg|gif|svg|woff|woff2)$/, loader: 'url-loader?limit=10000' },
{ test: /\.(eot|ttf|wav|mp3)$/, loader: 'file-loader' },
rules: [
{
test: /\.json$/,
loader: 'json-loader',
exclude: [
path.join(root, 'build', 'meteor', 'bundle', 'programs'),
]
},
{test: /\.txt$/, loader: 'raw-loader'},
{test: /\.(png|jpg|jpeg|gif|svg|woff|woff2)$/, use: [{loader: 'url-loader', options: {limit: 10000}}]},
{test: /\.(eot|ttf|wav|mp3)$/, loader: 'file-loader'},
{
test: /\.css$/,
loader: 'style!css?modules&importLoaders=1&localIdentName=[name]_[local]_[hash:base64:5]!postcss',
use: [
{loader: 'style-loader'},
{
loader: 'css-loader',
options: {
modules: true,
importLoaders: 1,
localIdentName: '[name]_[local]_[hash:base64:5]'
}
},
{loader: 'postcss-loader'}
],
exclude: globalCSS,
include: clientInclude,
},
{
test: /\.css$/,
loader: 'style!css',
use: [{loader: 'style-loader'}, {loader: 'css-loader'}],
include: globalCSS,
},
{
Expand Down
Loading