Skip to content

Commit

Permalink
Resolve Antora resources IDs on images (#614)
Browse files Browse the repository at this point in the history
Co-authored-by: Guillaume Grossetie <[email protected]>

Ref #434
  • Loading branch information
marieflorescontact authored Nov 15, 2022
1 parent 0f63eee commit 7a8ca10
Show file tree
Hide file tree
Showing 24 changed files with 6,786 additions and 4,403 deletions.
148 changes: 78 additions & 70 deletions extension-browser.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,75 +5,83 @@ const CopyWebpackPlugin = require('copy-webpack-plugin')
const { DefinePlugin } = require('webpack')

module.exports = {
entry: {
extension: './src/extension.ts'
},
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
target: 'webworker', // extensions run in a webworker context
resolve: {
mainFields: ['browser', 'module', 'main'],
extensions: ['.ts', '.js'], // support ts-files and js-files
fallback: {
'fs': false, // do not include a polyfill,
'assert': false,
'unxhr': false,
'glob': false,
'http': false,
'https': false,
'url': false,
'zlib': false,
'os': false,
'child_process': false,
'crypto': false,
'stream': false,
'path': require.resolve('path-browserify'),
'util': false
}
},
module: {
rules: [{
test: /\.ts$/,
exclude: /node_modules/,
use: [{
// configure TypeScript loader:
// * enable sources maps for end-to-end source maps
loader: 'ts-loader',
options: {
compilerOptions: {
'sourceMap': true,
},
configFile: 'tsconfig.browser.json'
entry: {
extension: './src/extension.ts'
},
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
target: 'webworker', // extensions run in a webworker context
resolve: {
mainFields: ['browser', 'module', 'main'],
extensions: ['.ts', '.js'], // support ts-files and js-files
fallback: {
'fs': false, // do not include a polyfill,
'assert': false,
'unxhr': false,
'glob': false,
'http': false,
'https': false,
'url': false,
'zlib': false,
'os': false,
'child_process': false,
'crypto': false,
'stream': false,
'path': require.resolve('path-browserify'),
'util': false,
'querystring': require.resolve('querystring'),
'tty': require.resolve('tty-browserify'),
'worker_threads': require.resolve('worker-thread')
}
}]
}]
},
externals: {
'vscode': 'commonjs vscode', // ignored because it doesn't exist,
'applicationinsights-native-metrics': 'commonjs applicationinsights-native-metrics', // ignored because we don't ship native module
'@opentelemetry/tracing': 'commonjs @opentelemetry/tracing' // ignored because we don't ship this module
},
performance: {
hints: false
},
output: {
// all output goes into `dist`.
// packaging depends on that and this must always be like it
filename: '[name].js',
path: path.join(__dirname, 'dist', 'browser'),
libraryTarget: 'commonjs',
},
amd: false, // disable amd
// yes, really source maps
devtool: 'source-map',
plugins: [
new CopyWebpackPlugin({
patterns: [
{ from: 'src', to: '.', globOptions: { ignore: ['**/test/**', '**/*.ts'] }, noErrorOnMissing: true }
]
}),
new DefinePlugin({
'process.env': JSON.stringify({}),
'process.env.BROWSER_ENV': JSON.stringify('true')
})
]
},
module: {
rules: [{
test: /\.ts$/,
exclude: /node_modules/,
use: [{
// configure TypeScript loader:
// * enable sources maps for end-to-end source maps
loader: 'ts-loader',
options: {
compilerOptions: {
'sourceMap': true,
},
configFile: 'tsconfig.browser.json'
}
}]
}]
},
externals: {
'vscode': 'commonjs vscode', // ignored because it doesn't exist,
'applicationinsights-native-metrics': 'commonjs applicationinsights-native-metrics', // ignored because we don't ship native module
'@opentelemetry/tracing': 'commonjs @opentelemetry/tracing' // ignored because we don't ship this module
},
performance: {
hints: false
},
output: {
// all output goes into `dist`.
// packaging depends on that and this must always be like it
filename: '[name].js',
path: path.join(__dirname, 'dist', 'browser'),
libraryTarget: 'commonjs',
},
amd: false, // disable amd
// yes, really source maps
devtool: 'source-map',
plugins: [
new CopyWebpackPlugin({
patterns: [
{
from: 'src',
to: '.',
globOptions: { ignore: ['**/test/**', '**/*.ts'] },
noErrorOnMissing: true
}
]
}),
new DefinePlugin({
'process.env': JSON.stringify({}),
'process.env.BROWSER_ENV': JSON.stringify('true')
})
]
}
6 changes: 5 additions & 1 deletion i18n/fra/package.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,9 @@
"asciidoc.useWorkspaceRoot.desc": "**Obsolète:** Quand on est dans un espace de travail, utilise la racine de l'espace de travail en tant que répertoire de base pour Asciidoctor",
"asciidoc.useWorkspaceRoot.deprecationMessage": "Ce paramètre a été remplacé par `#asciidoc.useWorkspaceRootAsBaseDirectory#` et n'a plus aucun effet.",
"asciidoc.use_kroki.desc": "**Obsolète:** Active l'extension Kroki afin de générer des diagrammes.",
"asciidoc.use_kroki.deprecationMessage": "Ce paramètre a été remplacé par `#asciidoc.extensions.enableKroki#` et n'a plus aucun effet."
"asciidoc.use_kroki.deprecationMessage": "Ce paramètre a été remplacé par `#asciidoc.extensions.enableKroki#` et n'a plus aucun effet.",

"asciidoc.antora.title": "Antora",
"asciidoc.antora.enableAntoraSupport.desc": "Active le support [Antora](https://antora.org/)."

}
5 changes: 4 additions & 1 deletion i18n/jpn/package.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,8 @@
"asciidoc.useWorkspaceRoot.desc": "**非推奨:** ワークスペースのルートパスをベースディレクトリとして使用します。",
"asciidoc.useWorkspaceRoot.deprecationMessage": "本設定は、`#asciidoc.useWorkspaceRootAsBaseDirectory#`に置き換えられ、動作しません。",
"asciidoc.use_kroki.desc": "**非推奨:** ダイアグラム生成Krokiを使用します。",
"asciidoc.use_kroki.deprecationMessage": "本設定は、`#asciidoc.extensions.enableKroki#`に置き換えられ、動作しません。"
"asciidoc.use_kroki.deprecationMessage": "本設定は、`#asciidoc.extensions.enableKroki#`に置き換えられ、動作しません。",

"asciidoc.antora.title": "Antora",
"asciidoc.antora.enableAntoraSupport.desc": "Enable [Antora](https://antora.org/) support."
}
Loading

0 comments on commit 7a8ca10

Please sign in to comment.