0

I want to save time, and I want to change the path when I build . Im using craco and this is craco.config.js ( I suppose I have to make some change here )

const CracoLessPlugin = require('craco-less');

module.exports = {
    
    plugins: [
        {
            plugin: CracoLessPlugin,
            options: {
                lessLoaderOptions: {
                    lessOptions: {
                        // modifyVars: { '@primary-color': '#1DA57A' },
                        javascriptEnabled: true,
                    },
                },
            },
        },
    ],
    
};

2 Answers2

0

Mattia.

You should be able to change the build path on the package.json in the "build" script, for example:

"scripts": {
   "start": "craco start",
   "build": "craco build && mv build whatever-folder-name",
   "test": "craco test"
}

Note: Please be aware of the issues it can bring to your application.

I hope I have understood well your question.

Source: NPM craco Docs

  • What kind of issues it can bring? anyway it doesnt work : - 'mv' is not recognized as an internal or external command, operable program or batch file. – Mattia Brieda Apr 19 '21 at 15:14
  • Hi, Mattia. Could you achieve what you want to? When I have refered about issues I have added a link (in the word issues) from another post for you to have a look, more specifically the one written by Kaloyan Kosev. About the "mv is not recognized ...", are you using yarn or npm? – Vinícius Cerqueira Bonifácio Apr 20 '21 at 11:23
0

You can use BUILD_PATH environment variabe to set custom output dir, check Use custom build output folder when using create-react-app

weeklyTea
  • 316
  • 2
  • 10