feat: hash the webpack-compiled js file

This commit is contained in:
endiliey 2018-08-11 16:29:52 +08:00
parent d33343b7c6
commit ea706d2830
2 changed files with 32 additions and 1 deletions

31
docs/highlight.md Normal file
View 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>
);
}
}
```

View file

@ -20,7 +20,7 @@ module.exports = function createBaseConfig(props) {
config
.mode(isProd ? 'production' : 'development')
.output.path(outDir)
.filename(isProd ? 'bundle.js' : '[name].js')
.filename(isProd ? '[name].[chunkhash].js' : '[name].js')
.publicPath(isProd ? baseUrl : '/');
if (!isProd) {