-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
144 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import loadConfigFromMeta from '@embroider/config-meta-loader'; | ||
|
||
export default loadConfigFromMeta('ember-api-docs'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
let config; | ||
|
||
// TODO - remove this once we have the better solution for injecting stage1 babel config into a real config file | ||
// this is needed because there are things (like ember-composible-helpers) that are now finding our babel config during | ||
// their stage1 build and historically they will never (99% of the time) have found any babel config. | ||
// we might need to keep something like this so that prebuild will never apply babel configs during stage1 i.e. a util | ||
// function that wraps your whole babel config | ||
if ( | ||
process.env.EMBROIDER_PREBUILD || | ||
process.env.EMBROIDER_TEST_SETUP_FORCE === 'classic' | ||
) { | ||
config = {}; | ||
} else { | ||
config = require('./node_modules/.embroider/_babel_config_'); | ||
} | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { defineConfig } from 'vite'; | ||
import { | ||
resolver, | ||
hbs, | ||
scripts, | ||
templateTag, | ||
optimizeDeps, | ||
compatPrebuild, | ||
assets, | ||
contentFor, | ||
} from '@embroider/vite'; | ||
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, | ||
}, | ||
plugins: [ | ||
hbs(), | ||
templateTag(), | ||
scripts(), | ||
resolver(), | ||
compatPrebuild(), | ||
assets(), | ||
contentFor(), | ||
|
||
babel({ | ||
babelHelpers: 'runtime', | ||
extensions, | ||
}), | ||
], | ||
optimizeDeps: optimizeDeps(), | ||
publicDir: resolve(process.cwd(), 'public'), | ||
server: { | ||
port: 4200, | ||
watch: { | ||
ignored: ['!**/tmp/rewritten-app/**'], | ||
}, | ||
}, | ||
build: { | ||
outDir: resolve(process.cwd(), 'dist'), | ||
rollupOptions: { | ||
input: { | ||
main: resolve(root, 'index.html'), | ||
...(shouldBuildTests(mode) | ||
? { tests: resolve(root, 'tests/index.html') } | ||
: undefined), | ||
}, | ||
}, | ||
}, | ||
}; | ||
}); | ||
|
||
function shouldBuildTests(mode) { | ||
return false; | ||
return mode !== 'production' || process.env.FORCE_BUILD_TESTS; | ||
} |