mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
feat: hash the webpack-compiled js file
This commit is contained in:
parent
d33343b7c6
commit
ea706d2830
2 changed files with 32 additions and 1 deletions
31
docs/highlight.md
Normal file
31
docs/highlight.md
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
---
|
||||||
|
id: highlight
|
||||||
|
title: Syntax highlighting demo
|
||||||
|
---
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
#include<bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
cout << "Hello world\n";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
class Example extends React.Component {
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
|
||||||
|
<Text>Docusaurus</Text>
|
||||||
|
<Button
|
||||||
|
title="Click me"
|
||||||
|
onPress={() => this.props.navigation.push('Docusaurus')}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
|
@ -20,7 +20,7 @@ module.exports = function createBaseConfig(props) {
|
||||||
config
|
config
|
||||||
.mode(isProd ? 'production' : 'development')
|
.mode(isProd ? 'production' : 'development')
|
||||||
.output.path(outDir)
|
.output.path(outDir)
|
||||||
.filename(isProd ? 'bundle.js' : '[name].js')
|
.filename(isProd ? '[name].[chunkhash].js' : '[name].js')
|
||||||
.publicPath(isProd ? baseUrl : '/');
|
.publicPath(isProd ? baseUrl : '/');
|
||||||
|
|
||||||
if (!isProd) {
|
if (!isProd) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue