Generate files in dist/static/ (#10221)
This commit is contained in:
Родитель
7338d4e01d
Коммит
0d76c35938
|
@ -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: {
|
||||
|
|
Загрузка…
Ссылка в новой задаче