F0rce/ace

Missing minified JS dependencies when building for production

hgoncalves opened this issue · 5 comments

Describe the bug
We we build for production it looks like webpack does no create a minified version of the js dependencies.

To Reproduce
Steps to reproduce the behavior:

<profile>
    <!-- Production mode is activated using -Pproduction -->
    <id>production</id>
    <build>
        <plugins>
            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <version>${vaadin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>build-frontend</goal>
                        </goals>
                        <phase>compile</phase>
                    </execution>
                </executions>
                <configuration>
                    <productionMode>true</productionMode>
                </configuration>
            </plugin>
        </plugins>
    </build>
</profile>
mvn -Pproduction verify -DskipITs=true -Dmaven.repo.local=.m2/

No changes were made to the default vaadin webpack.config.js

const merge = require('webpack-merge');
const flowDefaults = require('./webpack.generated.js');

module.exports = merge(flowDefaults, {

});

Error messages

[BABEL] Note: The code generator has deoptimised the styling of /Users/*ProjectPath*/node_modules/ace-builds/src-noconflict/ace.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /Users/*ProjectPath*/node_modules/ace-builds/src-noconflict/ace.js as it exceeds the max of 500KB.

Screenshots
https://imgur.com/a/u5N95Gs

F0rce commented

Hello @hgoncalves,

thanks for opening this issue, what Vaadin Version are you using ?

The error you see is just a note, which can be ignored completely. It just tells you that the ace.js file (which is the base of this whole project) will just be deoptimised, that the size gets decresed.

Could you please show me the link you use in the browser to open the view that contains the ace editor ?

Thanks in advance,
David

Hello @F0rce we are using version: 14.6.3 of Vaadin

I unfortunately have no unprotected route that you could access to see the message.

https://our-domain/ace-builds/src-min-noconflict/theme-chrome.js
https://our-domain/ace-builds/src-min-noconflict/mode-json.js

Build for prod locally we also have the issue.

Thanks for your help,
Hugo

F0rce commented

@hgoncalves,

no worries, I didn't mean to access your site. Could you try switching to Vaadin Version 14.6.6 with which the component has been packaged and published to the directory and are you making changes to the <AceEditor>.setBaseUrl() Method ?

I'm always here to help ;)
David

Great, updating to Vaadin's latest version solved it.

Thanks for your help ;)

F0rce commented

No Worries have a great day :)