This commit is contained in:
William Durand 2021-03-17 16:14:46 +01:00 коммит произвёл GitHub
Родитель 7338d4e01d
Коммит 0d76c35938
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 13 добавлений и 12 удалений

Просмотреть файл

@ -308,15 +308,15 @@
},
"bundlesize": [
{
"path": "./dist/amo-!(i18n-)*.js",
"path": "./dist/static/amo-!(i18n-)*.js",
"maxSize": "395 kB"
},
{
"path": "./dist/amo-i18n-*.js",
"path": "./dist/static/amo-i18n-*.js",
"maxSize": "33 kB"
},
{
"path": "./dist/amo-*.css",
"path": "./dist/static/amo-*.css",
"maxSize": "63 kB"
}
]

Просмотреть файл

@ -32,7 +32,6 @@ export const babelOptions = {
const webpackHost = config.get('webpackServerHost');
const webpackPort = config.get('webpackServerPort');
const assetsPath = path.resolve(__dirname, 'dist');
const hmr = `webpack-hot-middleware/client?path=//${webpackHost}:${webpackPort}/__webpack_hmr`;
@ -49,7 +48,6 @@ export default {
entry: entryPoints,
output: {
...webpackConfig.output,
path: assetsPath,
filename: '[name]-[contenthash].js',
chunkFilename: '[name]-[contenthash].js',
// We need to remove the protocol because of `yarn amo:dev-https`.

Просмотреть файл

@ -13,20 +13,25 @@ import { getPlugins, getRules } from './webpack-common';
import webpackIsomorphicToolsConfig from './src/amo/server/webpack-isomorphic-tools-config';
import { WEBPACK_ENTRYPOINT } from './src/amo/constants';
const entryPoints = { [WEBPACK_ENTRYPOINT]: 'amo/client' };
const DIST_DIR = path.join(__dirname, 'dist');
const STATIC_DIR = path.join(DIST_DIR, 'static');
export default {
bail: true,
mode: 'production',
devtool: 'source-map',
context: path.resolve(__dirname),
entry: entryPoints,
entry: { [WEBPACK_ENTRYPOINT]: 'amo/client' },
output: {
crossOriginLoading: 'anonymous',
path: path.join(__dirname, 'dist'),
// This is the path used to write the files on disk.
path: STATIC_DIR,
filename: '[name]-[contenthash].js',
chunkFilename: '[name]-[contenthash].js',
publicPath: config.has('staticHost') ? `${config.get('staticHost')}/` : '/',
// This is the path used to require files in the generated bundles.
publicPath: `${
config.has('staticHost') ? config.get('staticHost') : ''
}/static/`,
},
module: {
rules: getRules(),
@ -69,9 +74,7 @@ export default {
}),
new WebpackIsomorphicToolsPlugin(webpackIsomorphicToolsConfig),
new SubresourceIntegrityPlugin({ hashFuncNames: ['sha512'] }),
new SriDataPlugin({
saveAs: path.join(__dirname, 'dist', 'sri.json'),
}),
new SriDataPlugin({ saveAs: path.join(DIST_DIR, 'sri.json') }),
],
resolve: {
alias: {