Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync #64

Closed
wants to merge 2 commits into from
Closed

Sync #64

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion files-override/tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<script src="/testem.js" integrity="" data-embroider-ignore></script>
<script src="/@embroider/core/vendor.js"></script>
<script src="/@embroider/core/test-support.js"></script>
<script src="/@embroider/core/entrypoint" type="module"></script>
<script type="module">import "ember-testing";</script>

<script type="module">
Expand Down
41 changes: 19 additions & 22 deletions files/vite.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,20 @@ import {
import { resolve } from 'path';
import { babel } from '@rollup/plugin-babel';

const root = 'tmp/rewritten-app';
const extensions = [
'.mjs',
'.gjs',
'.js',
'.mts',
'.gts',
'.ts',
'.hbs',
'.json',
];

export default defineConfig(({ mode }) => {
return {
root,
cacheDir: resolve('node_modules', '.vite'),
resolve: {
extensions,
extensions: [
'.mjs',
'.gjs',
'.js',
'.mts',
'.gts',
'.ts',
'.hbs',
'.json',
],
},
plugins: [
hbs(),
Expand All @@ -42,24 +38,25 @@ export default defineConfig(({ mode }) => {

babel({
babelHelpers: 'runtime',
extensions,

// this needs .hbs because our hbs() plugin above converts them to
// javascript but the javascript still also needs babel, but we don't want
// to rename them because vite isn't great about knowing how to hot-reload
// them if we resolve them to made-up names.
extensions: ['.gjs', '.js', '.hbs', '.ts', '.gts'],
}),
],
optimizeDeps: optimizeDeps(),
publicDir: resolve(process.cwd(), 'public'),
server: {
port: 4200,
watch: {
ignored: ['!**/tmp/rewritten-app/**'],
},
},
build: {
outDir: resolve(process.cwd(), 'dist'),
outDir: 'dist',
rollupOptions: {
input: {
main: resolve(root, 'index.html'),
main: 'index.html',
...(shouldBuildTests(mode)
? { tests: resolve(root, 'tests/index.html') }
? { tests: 'tests/index.html' }
: undefined),
},
},
Expand Down
Loading