-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(repo): update imports, update webpack setup
- Loading branch information
Showing
19 changed files
with
2,294 additions
and
1,112 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
var webpack = require('webpack'); | ||
var WebpackDevServer = require('webpack-dev-server'); | ||
var config = require('./webpack.config'); | ||
const webpack = require('webpack'); | ||
const WebpackDevServer = require('webpack-dev-server'); | ||
const config = require('./webpack.config'); | ||
|
||
new WebpackDevServer(webpack(config), { | ||
publicPath: config.output.publicPath, | ||
hot: true, | ||
historyApiFallback: true | ||
}).listen(3000, 'localhost', function ( err ) { | ||
if ( err ) { | ||
console.log(err); | ||
} | ||
console.log('Listening at localhost:3000'); | ||
publicPath: config.output.publicPath, | ||
hot: true, | ||
historyApiFallback: true, | ||
}).listen(3000, 'localhost', err => { | ||
if (err) { | ||
console.log(err); | ||
} | ||
console.log('Listening at localhost:3000'); | ||
}); |
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
var path = require('path'); | ||
var webpack = require('webpack'); | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
|
||
module.exports = { | ||
devtool: 'eval', | ||
entry: [ | ||
'webpack-dev-server/client?http://localhost:3000', | ||
'webpack/hot/only-dev-server', | ||
'./src/index' | ||
devtool: 'eval', | ||
entry: [ | ||
'webpack-dev-server/client?http://localhost:3000', | ||
'webpack/hot/only-dev-server', | ||
'./src/index', | ||
], | ||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename: 'client.js', | ||
publicPath: '/dist/', | ||
}, | ||
plugins: [new webpack.HotModuleReplacementPlugin()], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /(node_modules|bower_components)/, | ||
use: { | ||
loader: 'babel-loader', | ||
}, | ||
}, | ||
], | ||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename: 'client.js', | ||
publicPath: '/dist/' | ||
}, | ||
plugins: [ | ||
new webpack.HotModuleReplacementPlugin() | ||
], | ||
module: { | ||
loaders: [{ | ||
test: /\.js$/, | ||
loaders: ['react-hot', 'babel'], | ||
include: path.join(__dirname, 'src') | ||
}] | ||
} | ||
}, | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,37 @@ | ||
var webpack = require('webpack'); | ||
var path = require('path'); | ||
const webpack = require('webpack'); | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
|
||
entry: { | ||
client: [path.join(__dirname, 'src/index.js')] | ||
}, | ||
|
||
output: { | ||
path: 'dist', | ||
filename: '[name].js' | ||
}, | ||
|
||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
'process.env': { | ||
NODE_ENV: JSON.stringify('production') | ||
} | ||
}), | ||
new webpack.optimize.DedupePlugin(), | ||
new webpack.optimize.UglifyJsPlugin(), | ||
new webpack.NoErrorsPlugin() | ||
entry: { | ||
client: [path.join(__dirname, 'src/index.js')], | ||
}, | ||
|
||
output: { | ||
path: path.join(__dirname, './dist'), | ||
filename: '[name].js', | ||
}, | ||
|
||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
'process.env': { | ||
NODE_ENV: JSON.stringify('production'), | ||
}, | ||
}), | ||
new webpack.optimize.UglifyJsPlugin(), | ||
new webpack.NoEmitOnErrorsPlugin(), | ||
], | ||
|
||
resolve: { | ||
extensions: ['.js', '.jsx', '.json'], | ||
}, | ||
node: { | ||
fs: 'empty', | ||
}, | ||
module: { | ||
loaders: [ | ||
{ test: /\.json/, loader: 'json-loader' }, | ||
{ test: /\.jsx$/, exclude: [/node_modules/], loader: 'babel-loader' }, | ||
{ test: /\.js$/, exclude: [/node_modules/], loader: 'babel-loader' }, | ||
], | ||
|
||
resolve: { | ||
extensions: ['', '.js', '.jsx', '.json'] | ||
}, | ||
node: { | ||
fs: 'empty' | ||
}, | ||
module: { | ||
loaders: [ | ||
{ test: /\.json/, loader: 'json-loader' }, | ||
{ test: /\.jsx$/, exclude: [/node_modules/], loader: 'babel' }, | ||
{ test: /\.js$/, exclude: [/node_modules/], loader: 'babel' } | ||
] | ||
} | ||
}, | ||
}; | ||
|
||
|
||
|
||
|
||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
var path = require('path'); | ||
var webpack = require('webpack'); | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
|
||
module.exports = { | ||
devtool: 'eval', | ||
entry: [ | ||
'webpack-dev-server/client?http://localhost:3000', | ||
'webpack/hot/only-dev-server', | ||
'./src/index' | ||
'./src/index', | ||
], | ||
resolve: { | ||
alias: { | ||
'react': 'inferno-compat', | ||
'react-dom': 'inferno-compat' | ||
} | ||
react: 'inferno-compat', | ||
'react-dom': 'inferno-compat', | ||
}, | ||
}, | ||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename: 'client.js', | ||
publicPath: '/dist/' | ||
publicPath: '/dist/', | ||
}, | ||
plugins: [ | ||
new webpack.HotModuleReplacementPlugin() | ||
], | ||
plugins: [new webpack.HotModuleReplacementPlugin()], | ||
module: { | ||
loaders: [{ | ||
test: /\.js$/, | ||
loaders: ['react-hot', 'babel'], | ||
include: path.join(__dirname, 'src') | ||
}] | ||
} | ||
loaders: [ | ||
{ | ||
test: /\.js$/, | ||
loaders: ['react-hot', 'babel'], | ||
include: path.join(__dirname, 'src'), | ||
}, | ||
], | ||
}, | ||
}; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
var path = require('path'); | ||
var webpack = require('webpack'); | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
|
||
module.exports = { | ||
devtool: 'eval', | ||
entry: [ | ||
'webpack-dev-server/client?http://localhost:3000', | ||
'webpack/hot/only-dev-server', | ||
'./src/index' | ||
'./src/index', | ||
], | ||
resolve: { | ||
alias: { | ||
'react': 'preact-compat', | ||
'react-dom': 'preact-compat' | ||
} | ||
react: 'preact-compat', | ||
'react-dom': 'preact-compat', | ||
}, | ||
}, | ||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename: 'client.js', | ||
publicPath: '/dist/' | ||
publicPath: '/dist/', | ||
}, | ||
plugins: [ | ||
new webpack.HotModuleReplacementPlugin() | ||
], | ||
plugins: [new webpack.HotModuleReplacementPlugin()], | ||
module: { | ||
loaders: [{ | ||
test: /\.js$/, | ||
loaders: ['react-hot', 'babel'], | ||
include: path.join(__dirname, 'src') | ||
}] | ||
} | ||
loaders: [ | ||
{ | ||
test: /\.js$/, | ||
loaders: ['react-hot', 'babel'], | ||
include: path.join(__dirname, 'src'), | ||
}, | ||
], | ||
}, | ||
}; |
Oops, something went wrong.