Skip to content

Commit 7f6e9d8

Browse files
committed
Added production config and eliminated build folder
1 parent f5687d9 commit 7f6e9d8

File tree

4 files changed

+71
-4
lines changed

4 files changed

+71
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules/
22
yarn-error.log
33
npm-error.log
44
/docs/node_modules
5+
/docs/build

docs/client/App.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ const App = () => (
1212
<div className={styles['app-wrapper']}>
1313
<AppNavbar />
1414
<div className="content-wrapper">
15+
<Route path="/install" component={GettingStartedPage} />
16+
<Route path="/playground" component={PlaygroundPage} />
17+
<Route path="/components" component={ComponentsPage} />
1518
<Route exact path="/" component={HomePage} />
16-
<Route exact path="/install" component={GettingStartedPage} />
17-
<Route exact path="/playground" component={PlaygroundPage} />
18-
<Route exact path="/components" component={ComponentsPage} />
1919
</div>
2020
</div>
2121
);

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Documentation of react-lite-ui",
55
"author": "Codebrahma",
66
"scripts": {
7-
"start": "cross-env NODE_ENV=production UV_THREADPOOL_SIZE=100 node ./server",
7+
"start": "cross-env UV_THREADPOOL_SIZE=100 node ./server",
88
"build": "cross-env NODE_ENV=production UV_THREADPOOL_SIZE=100 webpack --config ./webpack.config.production --colors --profile --progress",
99
"deploy": "gh-pages -d build"
1010
},

docs/webpack.config.production.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
const path = require('path');
2+
const webpack = require('webpack');
3+
const autoprefixer = require('autoprefixer');
4+
const ExtractTextPlugin = require('extract-text-webpack-plugin');
5+
const TransferWebpackPlugin = require('transfer-webpack-plugin');
6+
7+
module.exports = {
8+
mode: 'production',
9+
entry: [
10+
'./client/index.js'
11+
],
12+
context: __dirname,
13+
devtool: 'inline-source-map',
14+
output: {
15+
path: path.join(__dirname, 'build'),
16+
filename: 'docs.js',
17+
publicPath: '/'
18+
},
19+
resolve: {
20+
extensions: ['*', '.scss', '.js', '.json', '.md'],
21+
modules: [
22+
'node_modules',
23+
path.resolve(__dirname, './node_modules'),
24+
path.resolve(__dirname, './../node_modules'),
25+
path.resolve(__dirname, './../src')
26+
],
27+
alias: {
28+
'react-lite': path.resolve(__dirname + './../components')
29+
},
30+
},
31+
module: {
32+
rules: [
33+
{
34+
test: /\.js$/,
35+
exclude: /(node_modules)/,
36+
use: 'babel-loader'
37+
}, {
38+
test: /\.(scss|css)$/,
39+
use: [
40+
'style-loader',
41+
'css-loader',
42+
'sass-loader',
43+
],
44+
include: [ path.join(__dirname), path.join(__dirname, '../src'), /flexboxgrid/, /codemirror/ ],
45+
}, {
46+
test: /\.(txt)$/,
47+
use: 'raw-loader',
48+
include: path.resolve(__dirname, './app/components/layout/main/modules')
49+
}, {
50+
test: /\.(md)$/,
51+
use: ['html-loader', 'highlight-loader', 'markdown-loader']
52+
}
53+
]
54+
},
55+
plugins: [
56+
new ExtractTextPlugin('docs.css', { allChunks: true }),
57+
new TransferWebpackPlugin([{
58+
from: 'public/images',
59+
to: 'images'
60+
}], path.resolve(__dirname, './')),
61+
new webpack.HotModuleReplacementPlugin(),
62+
new webpack.DefinePlugin({
63+
'process.env.NODE_ENV': JSON.stringify('production')
64+
})
65+
]
66+
};

0 commit comments

Comments
 (0)