docs/ember-cli-build.js
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
function isProduction() {
return EmberApp.env() === 'production';
}
module.exports = function (defaults) {
const app = new EmberApp(defaults, {
'ember-cli-babel': { enableTypeScriptTransform: true },
autoImport: {
watchDependencies: ['ember-math-helpers'],
},
});
const { Webpack } = require('@embroider/webpack');
return require('@embroider/compat').compatBuild(app, Webpack, {
staticAddonTestSupportTrees: true,
staticAddonTrees: true,
staticHelpers: true,
staticModifiers: true,
staticComponents: true,
splitAtRoutes: [],
packageRules: [
{
package: 'ember-dynamic-render-template',
semverRange: '*',
addonTemplates: {
'templates/components/render-template.hbs': {
disambiguate: {
result: 'data',
},
},
},
},
],
packagerOptions: {
// publicAssetURL is used similarly to Ember CLI's asset fingerprint prepend option.
publicAssetURL: '/',
webpackConfig: {
module: {
rules: [
{
// When webpack sees an import for a CSS files
test: /\.css$/i,
exclude: /node_modules/,
use: [
{
// use the PostCSS loader addon
loader: 'postcss-loader',
options: {
sourceMap: isProduction() === false,
postcssOptions: {
config: './postcss.config.js',
},
},
},
],
},
],
},
},
},
extraPublicTrees: [],
});
};