get webpack dev server working
This commit is contained in:
parent
0788dd7109
commit
1840db6ec7
2
dist/main-bundle.js
vendored
2
dist/main-bundle.js
vendored
File diff suppressed because one or more lines are too long
@ -5,8 +5,7 @@
|
|||||||
"lint": "tslint --project tslint.json",
|
"lint": "tslint --project tslint.json",
|
||||||
"package": "yarn build --config webpack.config.prod.js --bail --display-used-exports -p",
|
"package": "yarn build --config webpack.config.prod.js --bail --display-used-exports -p",
|
||||||
"package-for-test": "yarn build --config webpack.config.test.js --bail --display-used-exports",
|
"package-for-test": "yarn build --config webpack.config.test.js --bail --display-used-exports",
|
||||||
"start": "webpack-dev-server --config webpack.config.js --progress --colors --port 8000 --env.WARN_ON_LINT",
|
"start": "./node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack.config.js --progress --colors --debug --output-pathinfo --port 8000 --env.WARN_ON_LINT",
|
||||||
"watch": "yarn build --config webpack.config.js --colors --debug --output-pathinfo --progress --watch --env.WARN_ON_LINT",
|
|
||||||
"build": "node ./node_modules/webpack/bin/webpack.js --cache=true --display-error-details --profile",
|
"build": "node ./node_modules/webpack/bin/webpack.js --cache=true --display-error-details --profile",
|
||||||
"clean": "rm -rf ./dist/*",
|
"clean": "rm -rf ./dist/*",
|
||||||
"tsnode": "node -r ts-node/register -r tsconfig-paths/register"
|
"tsnode": "node -r ts-node/register -r tsconfig-paths/register"
|
||||||
|
|||||||
@ -40,7 +40,7 @@ export class Header extends React.Component<IHeaderProps> {
|
|||||||
to="/explorer/1/0"
|
to="/explorer/1/0"
|
||||||
// style={ style }
|
// style={ style }
|
||||||
// className={ anchorCss }
|
// className={ anchorCss }
|
||||||
// onClick={ onClick }
|
onClick={ this.reload }
|
||||||
>
|
>
|
||||||
PVPokemon
|
PVPokemon
|
||||||
</Link>
|
</Link>
|
||||||
@ -56,4 +56,6 @@ export class Header extends React.Component<IHeaderProps> {
|
|||||||
</header>
|
</header>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private readonly reload = () => window.location.reload();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,10 +33,12 @@ module.exports = function (env) {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
devServer: {
|
devServer: {
|
||||||
contentBase: __dirname,
|
publicPath: '/' + options.outputDirectory + '/',
|
||||||
|
contentBase: [path.resolve(__dirname), path.resolve(__dirname, options.outputDirectory)],
|
||||||
historyApiFallback: true,
|
historyApiFallback: true,
|
||||||
|
// watchContentBase: true,
|
||||||
writeToDisk: true,
|
writeToDisk: true,
|
||||||
hot: false,
|
// hot: false,
|
||||||
},
|
},
|
||||||
entry: {
|
entry: {
|
||||||
'global': [
|
'global': [
|
||||||
|
|||||||
@ -2,7 +2,7 @@ const webpack = require('webpack');
|
|||||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||||
const WebpackShellPlugin = require('webpack-shell-plugin');
|
const WebpackShellPlugin = require('webpack-shell-plugin');
|
||||||
|
|
||||||
const outputDirectory = './dist';
|
const outputDirectory = 'dist';
|
||||||
module.exports.outputDirectory = outputDirectory;
|
module.exports.outputDirectory = outputDirectory;
|
||||||
|
|
||||||
module.exports.getOptimizations = function () {
|
module.exports.getOptimizations = function () {
|
||||||
@ -14,7 +14,7 @@ module.exports.getOptimizations = function () {
|
|||||||
filename: 'commons-bundle.js',
|
filename: 'commons-bundle.js',
|
||||||
chunks: 'initial',
|
chunks: 'initial',
|
||||||
// (the filename of the commons chunk)
|
// (the filename of the commons chunk)
|
||||||
minChunks: 2,
|
minChunks: 3,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -57,8 +57,8 @@ module.exports.getPlugins = function (env) {
|
|||||||
dev: false,
|
dev: false,
|
||||||
onBuildEnd:[
|
onBuildEnd:[
|
||||||
'echo "Starting CSS Merging"',
|
'echo "Starting CSS Merging"',
|
||||||
'node cssConcatenator.js ' + outputDirectory + ' global.tmp.css global.css ' + !!env.CSS_SOURCEMAPS,
|
'node cssConcatenator.js ./' + outputDirectory + ' global.tmp.css global.css ' + !!env.CSS_SOURCEMAPS,
|
||||||
'node cssConcatenator.js ' + outputDirectory + ' !(global).tmp.css app.css ' + !!env.CSS_SOURCEMAPS,
|
'node cssConcatenator.js ./' + outputDirectory + ' !(global).tmp.css app.css ' + !!env.CSS_SOURCEMAPS,
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user