Skip to content

Commit

Permalink
fix(cypress): Adjust config as global define for TRANSLATIONS is no…
Browse files Browse the repository at this point in the history
… longer needed

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Nov 24, 2023
1 parent c9fe21f commit 5fde15e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
4 changes: 0 additions & 4 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import path from 'path'
import webpackConfig from '@nextcloud/webpack-vue-config'
import webpackRules from '@nextcloud/webpack-vue-config/rules.js'

import { loadTranslations } from './build/translations.js'

const SCOPE_VERSION = Date.now();

(webpackRules.RULE_SCSS.use as webpack.RuleSetUse[]).push({
Expand Down Expand Up @@ -73,11 +71,9 @@ export default defineConfig({
framework: 'vue',
bundler: 'webpack',
webpackConfig: async () => {
const translations = await loadTranslations(path.resolve(__dirname, './l10n'))
webpackConfig.plugins.push(new webpack.DefinePlugin({
PRODUCTION: false,
SCOPE_VERSION,
TRANSLATIONS: JSON.stringify(translations),
}))

return webpackConfig
Expand Down
6 changes: 1 addition & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const path = require('path')

const { DefinePlugin } = require('webpack')
const BabelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-modules-except')
const { loadTranslations } = require('./build/translations.js')

const buildMode = process.env.NODE_ENV
const isDev = buildMode === 'development'
Expand Down Expand Up @@ -67,13 +66,10 @@ webpackRules.RULE_NODE_MJS = {

webpackConfig.module.rules = Object.values(webpackRules)

module.exports = async () => {
const translations = await loadTranslations(path.resolve(__dirname, './l10n'))

module.exports = () => {
webpackConfig.plugins.push(new DefinePlugin({
PRODUCTION: JSON.stringify(!isDev),
SCOPE_VERSION,
TRANSLATIONS: JSON.stringify(translations),
}))

return webpackConfig
Expand Down

0 comments on commit 5fde15e

Please sign in to comment.