この文書の現在のバージョンと選択したバージョンの差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
typescript:moduleのimport [2020/09/23 12:08] ips [5.ローカルサーバーの起動] |
typescript:moduleのimport [2020/09/23 12:09] (現在) ips [6.本番用のビルと] |
||
---|---|---|---|
ライン 62: | ライン 62: | ||
</WRAP> | </WRAP> | ||
- | ====== 6.本番用のビルと ====== | + | ====== 6.本番用のビルと ====== |
<code> | <code> | ||
npx parcel build index.html | npx parcel build index.html | ||
ライン 68: | ライン 68: | ||
<WRAP center round important 90%> | <WRAP center round important 90%> | ||
- | <script src="main.ts"></script>とトップディレクトリにtsファイルがあると、ビルド後は | + | htmlファイルのjs参照が |
+ | <script src="main.ts"></script> | ||
+ | のようにトップディレクトリにあると、ビルド後は | ||
<script src="/main.2799c73f.js">となってしまい、jsが参照できない。 | <script src="/main.2799c73f.js">となってしまい、jsが参照できない。 | ||
- | サブディレクトリを作成してtsの作成やコンパイルをするか | + | |
+ | サブディレクトリを作成してtsの作成やコンパイルをするか、コンパイル後のhtmlの参照を | ||
<script src="./main.2799c73f.js"> | <script src="./main.2799c73f.js"> | ||
<script src="main.2799c73f.js"> | <script src="main.2799c73f.js"> |