meilisearch-admin/ember-cli-build.js

69 lines
1.9 KiB
JavaScript
Raw Normal View History

'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
2022-04-26 08:23:47 +00:00
const { Webpack } = require('@embroider/webpack');
2022-08-13 10:27:04 +00:00
function isProduction() {
return EmberApp.env() === 'production';
}
module.exports = function (defaults) {
let app = new EmberApp(defaults, {
2022-08-20 15:16:52 +00:00
'ember-simple-auth': {
useSessionSetupMethod: true,
},
});
2022-04-26 08:23:47 +00:00
return require('@embroider/compat').compatBuild(app, Webpack, {
2022-08-13 10:27:04 +00:00
staticAddonTestSupportTrees: true,
staticAddonTrees: true,
staticHelpers: true,
staticModifiers: true,
2022-04-26 10:28:40 +00:00
staticComponents: true,
2022-08-13 10:27:04 +00:00
// splitAtRoutes: [],
packagerOptions: {
// publicAssetURL is used similarly to Ember CLI's asset fingerprint prepend option.
publicAssetURL: '/',
// Embroider lets us send our own options to the style-loader
cssLoaderOptions: {
// don't create source maps in production
sourceMap: isProduction() === false,
// enable CSS modules
modules: {
// global mode, can be either global or local
// we set to global mode to avoid hashing tailwind classes
mode: 'global',
// class naming template
localIdentName: isProduction()
? '[sha512:hash:base64:5]'
: '[path][name]__[local]',
},
},
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: './config/postcss.config.js',
},
},
},
],
},
],
},
},
},
extraPublicTrees: [],
2022-04-26 08:23:47 +00:00
});
};