Skip to content

Can we hot reload when assemblyscript source changes? #2

@tylers-username

Description

@tylers-username

First, great package. Thanks!

I have the following setup in Laravel:

import { defineConfig } from 'vite';
import laravel, { refreshPaths } from 'laravel-vite-plugin';
import basicSsl from '@vitejs/plugin-basic-ssl'
import assemblyScriptPlugin from "vite-plugin-assemblyscript-asc"

export default defineConfig({
    plugins: [
        assemblyScriptPlugin({
            projectRoot: '.',
            configFile: 'asconfig.json',
            srcMatch: 'resources/js/assembly',
            srcEntryFile: 'resources/js/assembly/index.ts',
            targetWasmFile: 'public/wasm/assembly.wasm',
            distFolder: 'public/wasm'
        }),
        laravel({
            input: [
                'resources/css/app.css',
                'resources/js/app.ts',
            ],
            refresh: [
                ...refreshPaths,
                'app/Http/Livewire/**',
            ],
        }),
        basicSsl(), // Ensure secure lando request can connect to vite
    ],
    server: { // For Lando, in general, accept request from anywhere
        https: true,
        host: true,
        port: 3009,
        hmr: {host: 'localhost', protocol: 'wss'},
    },
});

Vite does not rebuild when assembly/index.ts changes. Is that expected? Is there a configuration option that I am missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions