Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Merge 5d105db into dee2539
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Mar 30, 2017
2 parents dee2539 + 5d105db commit a2f02be
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 139 deletions.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"dependencies": {
"babel-runtime": "^6.11.6",
"bcrypt": "^0.8.7",
"es6-promisify": "^5.0.0",
"debug": "^2.2.0",
"es6-promisify": "^5.0.0",
"express": "^4.14.0",
"immutable": "^3.8.1",
"meteor-node-stubs": "~0.2.0",
Expand Down Expand Up @@ -77,17 +77,16 @@
"eslint-plugin-flowtype": "^2.17.1",
"eslint-plugin-react": "^6.2.1",
"eslint-watch": "^2.1.14",
"extract-text-webpack-plugin": "^2.0.0-beta.4",
"extract-text-webpack-plugin": "^2.1.0",
"file-loader": "^0.9.0",
"flow-bin": "^0.33.0",
"flow-watch": "^1.0.0",
"glob": "^7.0.6",
"happypack": "^2.2.1",
"happypack": "^3.0.3",
"http-proxy": "^1.14.0",
"istanbul": "^0.4.5",
"json-loader": "^0.5.4",
"json-string-loader": "^1.0.0",
"meteor-imports-webpack-plugin": "^2.0.0-beta.3",
"meteor-imports-webpack-plugin": "^2.0.0",
"mkdirp": "^0.5.1",
"mocha": "^3.0.2",
"node-inspector": "^0.12.8",
Expand All @@ -108,7 +107,7 @@
"wdio-phantomjs-service": "^0.2.2",
"wdio-spec-reporter": "0.0.3",
"webdriverio": "^4.2.11",
"webpack": "^2.1.0-beta.25",
"webpack": "^2.3.2",
"webpack-dev-middleware": "^1.7.0",
"webpack-hot-middleware": "^2.12.2",
"webpack-node-externals": "^1.3.3"
Expand Down
2 changes: 2 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// required by PostCSS
module.exports = {}
97 changes: 46 additions & 51 deletions webpack/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import path from 'path'
import webpack from 'webpack'
// import HappyPack from 'happypack'
import HappyPack from 'happypack'
import ProgressBarPlugin from 'progress-bar-webpack-plugin'
import MeteorImportsPlugin from 'meteor-imports-webpack-plugin'
import cssModulesValues from 'postcss-modules-values'
Expand Down Expand Up @@ -39,7 +39,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 @@ -49,12 +49,26 @@ const config = {
'process.env.TARGET': JSON.stringify(process.env.TARGET),
'process.env.NODE_ENV': JSON.stringify('development'),
}),
// disable HappyPack until it becomes compatible with webpack2 https://github.com/amireh/happypack/issues/91
// new HappyPack({
// id: '1', // https://github.com/amireh/happypack/issues/88
// loaders: ['babel'],
// threads: 4,
// }),
new HappyPack({
loaders: [{
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 webpack.LoaderOptionsPlugin({
options: {
postcss: [cssModulesValues]
Expand All @@ -64,65 +78,46 @@ const config = {
],
module: {
rules: [
{ test: /\.json$/,
use: [{loader: 'json-loader'}],
{
test: /\.json$/,
loader: 'json-loader',
exclude: [
path.join(root, 'node_modules', 'meteor-imports-webpack-plugin'),
path.join(root, 'build', 'meteor', 'bundle', 'programs'),
]},
{ test: /\.txt$/, use:[{loader: 'raw-loader'}] },
{ test: /\.(png|jpg|jpeg|gif|svg|woff|woff2)$/,
use:[{loader: 'url-loader', query: {limit: 10000}}]
]
},
{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)$/, use:[{loader: 'file-loader'}] },
{ test: /\.css$/,
use:[
{ loader: 'style-loader'},
{ loader: 'css-loader',
query: {
{test: /\.(eot|ttf|wav|mp3)$/, loader: 'file-loader'},
{
test: /\.css$/,
use: [
{loader: 'style-loader'},
{
loader: 'css-loader',
options: {
modules: true,
importLoaders: 1,
localIdentName: '[name]_[local]_[hash:base64:5]'
}
},
{ loader: 'postcss-loader'}
{loader: 'postcss-loader'},
],
exclude: globalCSS,
include: clientInclude,
},
{ test: /\.css$/,
use:[{loader: 'style-loader'}, {loader: 'css-loader'}],
{
test: /\.css$/,
use: [{loader: 'style-loader'}, {loader: 'css-loader'}],
include: globalCSS,
},
{ test: /\.js$/,
use:[{
loader: 'babel-loader',
options: {
"presets": [["es2015", {loose: true, modules: false}], "stage-1", "react", "flow"],
"plugins": [
"transform-runtime",
"react-hot-loader/babel",
],
"env": {
"coverage": {
"plugins": [
"istanbul"
]
}
}
},
}],
{
test: /\.js$/,
loader: 'happypack/loader',
include: clientInclude,
},
//This is a workaround, the meteor-config is supposed to be injected in meteor-imports-webpack-plugin
//but this does not work in webpack2.1.beta23+ so it is loaded here until a solution can be found
{ test: /meteor-config\.json$/,
include: [path.join(root, 'node_modules', 'meteor-imports-webpack-plugin')],
use: [{
loader: 'json-string-loader',
query: 'json=' + JSON.stringify(meteorConfig)
}]
}
],
},
watch: true,
Expand Down
91 changes: 42 additions & 49 deletions webpack/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import path from 'path'
import webpack from 'webpack'
import AssetsPlugin from 'assets-webpack-plugin'
// import HappyPack from 'happypack'
import HappyPack from 'happypack'
import ProgressBarPlugin from 'progress-bar-webpack-plugin'
import MeteorImportsPlugin from 'meteor-imports-webpack-plugin'
import cssModulesValues from 'postcss-modules-values'
Expand Down Expand Up @@ -50,9 +50,9 @@ const config = {
chunks: ['meteor']
}),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.optimize.MinChunkSizePlugin({ minChunkSize: 50000 }),
new webpack.NoErrorsPlugin(),
new AssetsPlugin({ path: buildDir, filename: 'assets.json' }),
new webpack.optimize.MinChunkSizePlugin({minChunkSize: 50000}),
new webpack.NoEmitOnErrorsPlugin(),
new AssetsPlugin({path: buildDir, filename: 'assets.json'}),
new webpack.DefinePlugin({
'__CLIENT__': true,
'Meteor.isClient': true,
Expand All @@ -62,13 +62,26 @@ const config = {
'process.env.NODE_ENV': JSON.stringify('production'),
}),
new webpack.IgnorePlugin(/\/server\//),
// disable HappyPack until it becomes compatible with webpack2 https://github.com/amireh/happypack/issues/91
// new HappyPack({
// id: '1', // https://github.com/amireh/happypack/issues/88
// cache: false,
// loaders: ['babel'],
// threads: 4,
// }),
new HappyPack({
cache: false,
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 webpack.LoaderOptionsPlugin({
minimize: true,
options: {
Expand All @@ -80,21 +93,23 @@ const config = {
],
module: {
rules: [
{ test: /\.json$/,
use: [{loader: 'json-loader'}],
{
test: /\.json$/,
loader: 'json-loader',
exclude: [
path.join(root, 'node_modules', 'meteor-imports-webpack-plugin'),
path.join(root, 'build', 'meteor', 'bundle', 'programs'),
]},
{ test: /\.txt$/, use:[{loader: 'raw-loader'}] },
{ test: /\.(png|jpg|jpeg|gif|svg|woff|woff2)$/, use:[{loader: 'url-loader', query: {limit: 10000}}] },
{ test: /\.(eot|ttf|wav|mp3)$/, use:[{loader: 'file-loader'}] },
{ test: /\.css$/,
use:[
]
},
{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$/,
use: [
{loader: 'style-loader'},
{
loader: 'css-loader',
query: {
options: {
modules: true,
importLoaders: 1,
localIdentName: '[name]_[local]_[hash:base64:5]'
Expand All @@ -105,38 +120,16 @@ const config = {
exclude: globalCSS,
include: clientInclude,
},
{ test: /\.css$/,
use:[{loader: 'style-loader'}, {loader: 'css-loader'}],
{
test: /\.css$/,
use: [{loader: 'style-loader'}, {loader: 'css-loader'}],
include: globalCSS,
},
{ test: /\.js$/,
use: [{
loader: 'babel-loader',
options: {
"presets": [["es2015", {loose: true, modules: false}], "stage-1", "react", "flow"],
"plugins": [
"transform-runtime",
],
"env": {
"coverage": {
"plugins": [
"istanbul"
]
}
}
},
}],
{
test: /\.js$/,
loader: 'happypack/loader',
include: clientInclude,
},
//This is a workaround, the meteor-config is supposed to be injected in meteor-imports-webpack-plugin
//but this does not work in webpack2.1.beta23+ so it is loaded here until a solution can be found
{ test: /meteor-config\.json$/,
include: [path.join(root, 'node_modules', 'meteor-imports-webpack-plugin')],
use: [{
loader: 'json-string-loader',
query: 'json=' + JSON.stringify(meteorConfig)
}]
}
],
},
}
Expand Down
Loading

0 comments on commit a2f02be

Please sign in to comment.