Commit 383eec36 authored by Arunoda Susiripala's avatar Arunoda Susiripala Committed by GitHub

We are using some divs to wrap some script tags. (#1867)

We don't need them.
So, this change will remove them.
parent 5e393b14
...@@ -108,6 +108,7 @@ export class NextScript extends Component { ...@@ -108,6 +108,7 @@ export class NextScript extends Component {
return ( return (
<script <script
key={filename}
type='text/javascript' type='text/javascript'
src={`${assetPrefix}/_next/${hash}/${filename}`} src={`${assetPrefix}/_next/${hash}/${filename}`}
{...additionalProps} {...additionalProps}
...@@ -118,18 +119,16 @@ export class NextScript extends Component { ...@@ -118,18 +119,16 @@ export class NextScript extends Component {
getScripts () { getScripts () {
const { dev } = this.context._documentProps const { dev } = this.context._documentProps
if (dev) { if (dev) {
return ( return [
<div> this.getChunkScript('manifest.js'),
{ this.getChunkScript('manifest.js') } this.getChunkScript('commons.js'),
{ this.getChunkScript('commons.js') } this.getChunkScript('main.js')
{ this.getChunkScript('main.js') } ]
</div>
)
} }
// In the production mode, we have a single asset with all the JS content. // In the production mode, we have a single asset with all the JS content.
// So, we can load the script with async // So, we can load the script with async
return this.getChunkScript('app.js', { async: true }) return [this.getChunkScript('app.js', { async: true })]
} }
render () { render () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment