Skip to content
This repository has been archived by the owner on May 15, 2022. It is now read-only.

Commit

Permalink
I deleted mapboxgl from webpack, because bundle.js size will be very …
Browse files Browse the repository at this point in the history
…huge
  • Loading branch information
Jin IGARASHI committed Jul 9, 2020
1 parent 3759c9f commit 7b99315
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const build = () =>{
fs.writeFileSync('./dist/CNAME', process.env.CNAME);
}

exec("webpack", (error, stdout, stderr) => {
exec("webpack --mode production", (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`);
return;
Expand Down
8 changes: 4 additions & 4 deletions dist/bundle.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
<title>Water Supply Map for Narok Water</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<link rel=”shortcut icon” href=”favicon.ico” />
<link href='https://api.mapbox.com/mapbox-gl-js/v1.11.1/mapbox-gl.css' rel='stylesheet' />
</head>
<body>
<div id="map"></div>
<script src='https://api.mapbox.com/mapbox-gl-js/v1.11.1/mapbox-gl.js'></script>
<script src="bundle.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-170080825-1"></script>
Expand Down
3 changes: 3 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@ module.exports = {
publicPath: '/',
watchContentBase: true,
open: true
},
externals: {
'mapbox-gl': 'mapboxgl'
}
};

0 comments on commit 7b99315

Please sign in to comment.