Merge pull request #9014 from vector-im/dbkr/langs_file_resolve_alias
Set a require alias for the webapp directory
This commit is contained in:
commit
4a5a73597c
2 changed files with 3 additions and 12 deletions
|
@ -14,11 +14,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
npm run clean
|
npm run clean
|
||||||
# riot-web is at `workspace`.
|
npm run build$dev
|
||||||
# matrix-react-sdk is at `workspace/node_modules/matrix-react-sdk`, but this is
|
|
||||||
# symlinked to a repo at `workspace/matrix-react-sdk`.
|
|
||||||
# To get from `workspace/matrix-react-sdk/lib` up to the lang file, we use:
|
|
||||||
RIOT_LANGUAGES_FILE="../../webapp/i18n/languages.json" npm run build$dev
|
|
||||||
|
|
||||||
# include the sample config in the tarball. Arguably this should be done by
|
# include the sample config in the tarball. Arguably this should be done by
|
||||||
# `npm run build`, but it's just too painful.
|
# `npm run build`, but it's just too painful.
|
||||||
|
|
|
@ -6,12 +6,6 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
let og_image_url = process.env.RIOT_OG_IMAGE_URL;
|
let og_image_url = process.env.RIOT_OG_IMAGE_URL;
|
||||||
if (!og_image_url) og_image_url = 'https://riot.im/app/themes/riot/img/logos/riot-im-logo-black-text.png';
|
if (!og_image_url) og_image_url = 'https://riot.im/app/themes/riot/img/logos/riot-im-logo-black-text.png';
|
||||||
|
|
||||||
// relative to languageHandler.js in matrix-react-sdk
|
|
||||||
let RIOT_LANGUAGES_FILE = process.env.RIOT_LANGUAGES_FILE;
|
|
||||||
if (!RIOT_LANGUAGES_FILE) {
|
|
||||||
RIOT_LANGUAGES_FILE = "../../riot-web/webapp/i18n/languages.json";
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: {
|
entry: {
|
||||||
// Load babel-polyfill first to avoid issues where some imports (namely react)
|
// Load babel-polyfill first to avoid issues where some imports (namely react)
|
||||||
|
@ -157,6 +151,8 @@ module.exports = {
|
||||||
|
|
||||||
// same goes for js-sdk
|
// same goes for js-sdk
|
||||||
"matrix-js-sdk": path.resolve('./node_modules/matrix-js-sdk'),
|
"matrix-js-sdk": path.resolve('./node_modules/matrix-js-sdk'),
|
||||||
|
|
||||||
|
"$webapp": path.resolve('./webapp'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
@ -164,7 +160,6 @@ module.exports = {
|
||||||
'process.env': {
|
'process.env': {
|
||||||
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
|
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
|
||||||
},
|
},
|
||||||
'LANGUAGES_FILE': JSON.stringify(RIOT_LANGUAGES_FILE),
|
|
||||||
}),
|
}),
|
||||||
new ExtractTextPlugin("bundles/[hash]/[name].css", {
|
new ExtractTextPlugin("bundles/[hash]/[name].css", {
|
||||||
allChunks: true,
|
allChunks: true,
|
||||||
|
|
Loading…
Reference in a new issue