extjsextjs7

ExtJs Adding additional files to build


How to use 'app.json' to add additional files to the production build when I use the following command

sencha app build

For example, I have some static HTML pages updated regularly located in the root directory, so I want those files to be copied to the production directory


Solution

  • You can use the build.xml file located in the project's root directroy. Add the following to the main <project> block:

    <target name="-after-build">
        <copy todir="${build.dir}/myfolder">
            <fileset dir="${app.dir}/myfolder" />
        </copy>
        <copy todir="${build.dir}">
            <fileset dir="${app.dir}">
                <include name="favicon.ico"/>
            </fileset>
        </copy>
    </target>
    

    The first example copies an entire folder, the second copies a file from the project root folder to the build folder.