mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-06 14:16:50 +02:00
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,3 @@
|
|||||||
.netlify
|
.netlify
|
||||||
dist
|
build
|
||||||
node_modules
|
node_modules
|
10
package.json
10
package.json
@@ -1,14 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "csslayout",
|
"name": "csslayout",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"copy": "cp client/index.html dist && cp robots.txt dist && cp sitemap.xml dist",
|
"copy": "rm -rf build && mkdir build && cp client/index.html build && cp robots.txt build && cp sitemap.xml build",
|
||||||
"dev": "npm run copy && webpack --mode development",
|
"dev": "npm run copy && webpack --mode development",
|
||||||
"dev-server": "npm run copy && webpack-dev-server",
|
"dev-server": "npm run copy && webpack-dev-server",
|
||||||
"prebuild": "rm -rf dist/* && npm run copy",
|
"build": "npm run copy && webpack --mode production && npm run export",
|
||||||
"build": "webpack --mode production",
|
|
||||||
"export": "react-snap",
|
"export": "react-snap",
|
||||||
"postbuild": "npm run export",
|
"deploy": "npm run build && netlify deploy --dir=build --prod"
|
||||||
"deploy": "netlify deploy --dir=dist --prod"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@loadable/component": "^5.10.3",
|
"@loadable/component": "^5.10.3",
|
||||||
@@ -30,7 +28,7 @@
|
|||||||
"webpack-dev-server": "^3.9.0"
|
"webpack-dev-server": "^3.9.0"
|
||||||
},
|
},
|
||||||
"reactSnap": {
|
"reactSnap": {
|
||||||
"source": "dist",
|
"source": "build",
|
||||||
"minifyHtml": {
|
"minifyHtml": {
|
||||||
"collapseWhitespace": false,
|
"collapseWhitespace": false,
|
||||||
"removeComments": false
|
"removeComments": false
|
||||||
|
@@ -3,8 +3,13 @@ const path = require('path');
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
entry: './client/index.jsx',
|
entry: './client/index.jsx',
|
||||||
output: {
|
output: {
|
||||||
path: path.join(__dirname, 'dist'),
|
path: path.join(__dirname, 'build'),
|
||||||
filename: 'bundle.js',
|
filename: 'bundle.js',
|
||||||
|
// It's very important
|
||||||
|
// All the chunk generated by webpack then will be loaded such as
|
||||||
|
// <script charset="utf-8" src="/[chunk-name].bundle.js"></script>
|
||||||
|
// The script is accessible from any page that exported by a 3rd party such as react-snap
|
||||||
|
publicPath: '/',
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
@@ -24,7 +29,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
devtool: 'cheap-module-eavl-source-map',
|
devtool: 'cheap-module-eavl-source-map',
|
||||||
devServer: {
|
devServer: {
|
||||||
contentBase: path.join(__dirname, 'dist'),
|
contentBase: path.join(__dirname, 'build'),
|
||||||
historyApiFallback: true,
|
historyApiFallback: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user