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

Watch is not picking up new files after dev-server started #62

Open
oscarviq opened this issue Sep 24, 2020 · 1 comment
Open

Watch is not picking up new files after dev-server started #62

oscarviq opened this issue Sep 24, 2020 · 1 comment

Comments

@oscarviq
Copy link

Hi, I'm working on an Angular application and using the plugin to merge i18n files. It's working great however I've noticed that if I start a dev server ng serve it will detect changes on existing files and re compile but If I add a new json file I have to stop the dev server and re-start it for webpack to watch the new file.

I'm guessing it has something to do with the fact that when a new .json file is created it's blank and that would error out the plugin.

Thanks in advanced.

Dependencies:
"@angular-builders/custom-webpack": "^9.2.0",
"@angular-devkit/architect": ">= 0.900 < 0.1100",
"@angular-devkit/build-angular": "~0.901.1",
"merge-jsons-webpack-plugin": "^1.0.21",

custom-webpack.config.ts

import * as webpack from 'webpack';
import * as MergeJsons from 'merge-jsons-webpack-plugin';

const LANGUAGES = [
    'english',
    'español'
];

export default {
    plugins: [
        new MergeJsons({
            debug: true,
            output: {
                groupBy: LANGUAGES.map((language: string) => {

                    return {
                        pattern: `./src/app/**/${ language }.json`,
                        fileName: `./assets/i18n/${ language }.json`
                    };

                })
            },
            globOptions: {
                nosort: true
            }
        })
    ]
} as webpack.Configuration;
@aarthishuba
Copy link
Collaborator

@eruecco87 new version 2.0.0-alpha is published, it should fix the issue, however it has some breaking changes in case of arrays, please refer to read me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants