Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

[WIP] Update dependencies and support Node 12 #139

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions client/.babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"presets": [
"env",
"react"
"@babel/preset-env",
"@babel/preset-react"
]
}
18 changes: 0 additions & 18 deletions client/cfg/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@
let path = require('path');
let defaultSettings = require('./defaults');

// Additional npm or bower modules to include in builds
// Add all foreign plugins you may need into this array
// @example:
// let npmBase = path.join(__dirname, '../node_modules');
// let additionalPaths = [ path.join(npmBase, 'react-bootstrap') ];
let additionalPaths = [];

module.exports = {
additionalPaths: additionalPaths,
port: defaultSettings.port,
debug: true,
devtool: 'eval',
output: {
path: path.join(__dirname, '/../dist/assets'),
Expand All @@ -28,7 +18,6 @@ module.exports = {
noInfo: false
},
resolve: {
extensions: ['', '.js', '.jsx'],
alias: {
actions: `${defaultSettings.srcPath}/actions/`,
components: `${defaultSettings.srcPath}/components/`,
Expand All @@ -39,11 +28,4 @@ module.exports = {
}
},
module: {},
postcss: function () {
return [
require('autoprefixer')({
browsers: ['last 5 versions', 'ie >= 8', 'last 5 iOS versions']
})
];
}
};
19 changes: 6 additions & 13 deletions client/cfg/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ const srcPath = path.join(__dirname, '/../src');
const dfltPort = 8000;
function getDefaultModules() {
return {
preLoaders: [{
rules: [
{
test: /\.(js|jsx)$/,
include: srcPath,
loader: 'eslint-loader'
}],
loaders: [
loader: 'eslint-loader',
enforce: 'pre'
},
{
test: /\.(html)$/,
loader: 'html-loader',
Expand Down Expand Up @@ -70,13 +71,5 @@ module.exports = {
srcPath: srcPath,
publicPath: '/assets/',
port: dfltPort,
getDefaultModules: getDefaultModules,
postcss: function () {
return [
// require('autoprefixer')({
// browsers: ['last 5 versions', 'ie >= 8', 'last 5 iOS versions']
// })
];

}
getDefaultModules: getDefaultModules
};
39 changes: 27 additions & 12 deletions client/cfg/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ let path = require('path');
let webpack = require('webpack');
let baseConfig = require('./base');
let defaultSettings = require('./defaults');

// Add needed plugins here
let BowerWebpackPlugin = require('bower-webpack-plugin');
let autoprefixer = require('autoprefixer');

let config = Object.assign({}, baseConfig, {
entry: [
Expand All @@ -15,25 +13,42 @@ let config = Object.assign({}, baseConfig, {
'./src/index'
],
cache: true,
devServer: {
contentBase: './src/',
historyApiFallback: true,
hot: false,
port: defaultSettings.port,
publicPath: defaultSettings.publicPath,
noInfo: false
},
devtool: 'eval-source-map',
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new BowerWebpackPlugin({
searchResolveModulesDirectories: false
})
new webpack.NoEmitOnErrorsPlugin(),
new webpack.LoaderOptionsPlugin({
options: {
context: __dirname,
postcss: [
autoprefixer
]
}
})
],
module: defaultSettings.getDefaultModules()
});

// Add needed loaders to the defaults here
config.module.loaders.push({
config.module.rules.push({
test: /\.(js|jsx)$/,
loader: require.resolve('babel-loader'),
include: [].concat(
config.additionalPaths,
[ path.join(__dirname, '/../src') ]
),
exclude: [
/node_modules[\\\/]react-waypoint/,
/node_modules[\\\/]consolidated-events/
],
//include: [].concat(
// config.additionalPaths,
// [ path.join(__dirname, '/../src') ]
//),
options: {
cacheDirectory: true,
plugins: ['react-hot-loader/babel'],
Expand Down
8 changes: 1 addition & 7 deletions client/cfg/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ let webpack = require('webpack');
let baseConfig = require('./base');
let defaultSettings = require('./defaults');

// Add needed plugins here
let BowerWebpackPlugin = require('bower-webpack-plugin');

let config = Object.assign({}, baseConfig, {
entry: ['babel-polyfill', path.join(__dirname, '../src/index')],
cache: false,
Expand All @@ -18,13 +15,10 @@ let config = Object.assign({}, baseConfig, {
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
}),
new BowerWebpackPlugin({
searchResolveModulesDirectories: false
}),
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.NoErrorsPlugin()
new webpack.NoEmitOnErrorsPlugin()
],
module: defaultSettings.getDefaultModules(),
postcss: function () {
Expand Down
22 changes: 6 additions & 16 deletions client/cfg/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,18 @@ let srcPath = path.join(__dirname, '/../src/');

let baseConfig = require('./base');

// Add needed plugins here
let BowerWebpackPlugin = require('bower-webpack-plugin');

module.exports = {
devtool: 'eval',
module: {
preLoaders: [
loaders: [
{
test: /\.(js|jsx)$/,
loader: 'isparta-instrumenter-loader',
loader: 'isparta-loader',
include: [
path.join(__dirname, '/../src')
]
}
],
loaders: [
],
enforce: 'pre'
},
{
test: /\.(png|svg|jpg|gif|woff|woff2|css|sass|scss|less|styl)$/,
loader: 'null-loader'
Expand All @@ -39,7 +35,6 @@ module.exports = {
]
},
resolve: {
extensions: [ '', '.js', '.jsx' ],
alias: {
actions: srcPath + 'actions/',
helpers: path.join(__dirname, '/../test/helpers'),
Expand All @@ -49,10 +44,5 @@ module.exports = {
styles: srcPath + 'styles/',
config: srcPath + 'config/' + process.env.REACT_WEBPACK_ENV
}
},
plugins: [
new BowerWebpackPlugin({
searchResolveModulesDirectories: false
})
]
}
};
Loading