evenchange4 / react-intl.macro

Extract react-intl messages with babel-plugin-macros.
MIT License
37 stars 6 forks source link

'MESSAGE_DIR' is not recognized as an internal or external command - when running extract script #100

Closed paunovic-stefan closed 4 years ago

paunovic-stefan commented 4 years ago

I'm trying to use this in a react application created with CreateReactApplication

when running npm run extract i get the following error message 'MESSAGE_DIR' is not recognized as an internal or external command

package.json script is as follows

"scripts": {
    "extract": "MESSAGE_DIR='./src/translations/extractedMessages' react-scripts build"
}
oahmaro commented 4 years ago

I have same issue, please help

paunovic-stefan commented 4 years ago

the problem was that the script is for Linux and Mac OSX... on windows the script needs to be modified to: set MESSAGE_DIR='./src/translations/extractedMessages'&& react-scripts build

or even better install cross-env npm module and modify the script to: cross-env MESSAGE_DIR='./src/translations/extractedMessages' react-scripts build to be able to run on any OS

pshadow commented 4 years ago

I have to use set MESSAGE_DIR=./src/i18n/extractedMessages&&react-scripts build on Windows.