added hash to js bundle names (#1803)

main
Andrey Zhavoronkov 6 years ago committed by GitHub
parent 99860d8171
commit db29291d43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -60,10 +60,12 @@ const webConfig = {
target: 'web', target: 'web',
mode: 'production', mode: 'production',
devtool: 'source-map', devtool: 'source-map',
entry: './src/typescript/canvas.ts', entry: {
'cvat-canvas': './src/typescript/canvas.ts',
},
output: { output: {
path: path.resolve(__dirname, 'dist'), path: path.resolve(__dirname, 'dist'),
filename: 'cvat-canvas.js', filename: '[name].[contenthash].js',
library: 'canvas', library: 'canvas',
libraryTarget: 'window', libraryTarget: 'window',
}, },

@ -30,10 +30,12 @@ const webConfig = {
target: 'web', target: 'web',
mode: 'production', mode: 'production',
devtool: 'source-map', devtool: 'source-map',
entry: './src/api.js', entry: {
'cvat-core': './src/api.js',
},
output: { output: {
path: path.resolve(__dirname, 'dist'), path: path.resolve(__dirname, 'dist'),
filename: 'cvat-core.min.js', filename: '[name].[contenthash].min.js',
library: 'cvat', library: 'cvat',
libraryTarget: 'window', libraryTarget: 'window',
}, },
@ -58,7 +60,7 @@ const webConfig = {
loader: 'worker-loader', loader: 'worker-loader',
options: { options: {
publicPath: '/static/engine/js/3rdparty/', publicPath: '/static/engine/js/3rdparty/',
name: '[name].js', name: '[name].[contenthash].js',
}, },
}, },
}, { }, {
@ -68,7 +70,7 @@ const webConfig = {
loader: 'worker-loader', loader: 'worker-loader',
options: { options: {
publicPath: '/static/engine/js/', publicPath: '/static/engine/js/',
name: '[name].js', name: '[name].[contenthash].js',
}, },
}, },
}, },

@ -9,10 +9,12 @@ const CopyPlugin = require('copy-webpack-plugin');
const cvatData = { const cvatData = {
target: 'web', target: 'web',
mode: 'production', mode: 'production',
entry: './src/js/cvat-data.js', entry: {
'cvat-data': './src/js/cvat-data.js',
},
output: { output: {
path: path.resolve(__dirname, 'dist'), path: path.resolve(__dirname, 'dist'),
filename: 'cvat-data.min.js', filename: '[name].[contenthash].min.js',
library: 'cvatData', library: 'cvatData',
libraryTarget: 'window', libraryTarget: 'window',
}, },
@ -39,7 +41,7 @@ const cvatData = {
loader: 'worker-loader', loader: 'worker-loader',
options: { options: {
publicPath: '/', publicPath: '/',
name: '[name].js', name: '[name].[contenthash].js',
}, },
}, },
}, { }, {
@ -48,7 +50,7 @@ const cvatData = {
loader: 'worker-loader', loader: 'worker-loader',
options: { options: {
publicPath: '/3rdparty/', publicPath: '/3rdparty/',
name: '3rdparty/[name].js', name: '3rdparty/[name].[contenthash].js',
}, },
}, },
}, },

@ -15,6 +15,5 @@
<body> <body>
<div id="root"></div> <div id="root"></div>
<script src="/cvat-ui.min.js" type="text/javascript"></script>
</body> </body>
</html> </html>

@ -14,10 +14,13 @@ module.exports = {
target: 'web', target: 'web',
mode: 'production', mode: 'production',
devtool: 'source-map', devtool: 'source-map',
entry: './src/index.tsx', entry: {
'cvat-ui': './src/index.tsx',
},
output: { output: {
path: path.resolve(__dirname, 'dist'), path: path.resolve(__dirname, 'dist'),
filename: 'cvat-ui.min.js', filename: '[name].[contenthash].min.js',
publicPath: '/',
}, },
devServer: { devServer: {
contentBase: path.join(__dirname, 'dist'), contentBase: path.join(__dirname, 'dist'),
@ -79,7 +82,7 @@ module.exports = {
loader: 'worker-loader', loader: 'worker-loader',
options: { options: {
publicPath: '/', publicPath: '/',
name: '3rdparty/[name].js', name: '3rdparty/[name].[contenthash].js',
}, },
}, },
}, { }, {
@ -89,7 +92,7 @@ module.exports = {
loader: 'worker-loader', loader: 'worker-loader',
options: { options: {
publicPath: '/', publicPath: '/',
name: '[name].js', name: '[name].[contenthash].js',
}, },
}, },
},], },],
@ -97,7 +100,7 @@ module.exports = {
plugins: [ plugins: [
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: "./src/index.html", template: "./src/index.html",
inject: false, inject: 'body',
}), }),
new Dotenv({ new Dotenv({
systemvars: true, systemvars: true,

Loading…
Cancel
Save