forked from mother/react-files
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated React, Babel, Webpack dependencies. Updated Webpack configura…
…tion files.
- Loading branch information
Showing
7 changed files
with
68 additions
and
67 deletions.
There are no files selected for viewing
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,3 +1,3 @@ | ||
{ | ||
"presets": ["es2015", "stage-0", "react"] | ||
"presets": ["@babel/env", "@babel/stage-0", "@babel/react"] | ||
} |
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,4 +1,5 @@ | ||
.DS_Store | ||
node_modules | ||
npm-debug.log | ||
.tmp/* | ||
.uploads/* |
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
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,31 +1,25 @@ | ||
const path = require('path') | ||
const webpack = require('webpack') | ||
|
||
module.exports = { | ||
entry: './src/index.js', | ||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename: 'index.js', | ||
libraryTarget: 'umd', | ||
publicPath: '/static/' | ||
}, | ||
plugins: [ | ||
new webpack.optimize.UglifyJsPlugin({ | ||
compress: { warnings: false } | ||
}) | ||
], | ||
externals: { | ||
'react': 'react' | ||
}, | ||
module: { | ||
loaders: [{ | ||
test: /\.js$/, | ||
loaders: ['babel'], | ||
include: path.join(__dirname, 'src') | ||
}], | ||
resolve: { | ||
// Can require('file') instead of require('file.js') etc. | ||
extensions: ['', '.js', '.json'] | ||
} | ||
} | ||
mode: 'production', | ||
entry: { | ||
main: './src/index.js' | ||
}, | ||
output: { | ||
path: path.resolve(__dirname, 'dist'), | ||
filename: 'index.js', | ||
libraryTarget: 'umd' | ||
}, | ||
externals: { | ||
react: 'react' | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
use: ['babel-loader'] | ||
} | ||
] | ||
} | ||
} |
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,25 +1,31 @@ | ||
var path = require('path') | ||
var webpack = require('webpack') | ||
const path = require('path') | ||
const webpack = require('webpack') | ||
|
||
module.exports = { | ||
devtool: 'eval', | ||
entry: [ | ||
'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000', | ||
'./src/demo' | ||
], | ||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename: 'bundle.js', | ||
publicPath: '/static/' | ||
}, | ||
plugins: [ | ||
new webpack.HotModuleReplacementPlugin() | ||
], | ||
module: { | ||
loaders: [{ | ||
test: /\.js$/, | ||
loaders: ['react-hot', 'babel'], | ||
include: path.join(__dirname, 'src') | ||
}] | ||
} | ||
mode: 'development', | ||
entry: [ | ||
'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000', | ||
'./src/demo.js' | ||
], | ||
output: { | ||
path: path.resolve(__dirname, 'dist'), | ||
filename: 'bundle.js', | ||
publicPath: '/static/' | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
use: ['babel-loader'] | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new webpack.HotModuleReplacementPlugin() | ||
], | ||
resolve: { | ||
extensions: ['.js'], | ||
enforceExtension: false | ||
} | ||
} |