Closed justinjzs closed 7 years ago
webpack.config.js:
alias: { 'react-df': path.join(__dirname, 'src/react-df.js'), }
.babelrc:
"env": { "test": { "plugins": [ "babel-plugin-webpack-alias", { "config": "./webpack.config.js" } ] }
xxx.test.js:
import df from 'react-df' ......
when i run with cmd: "set NODE_ENV=test && mocha --compilers js:babel-register test/*/.test.js" the error message is "Cannot find module 'react-df'"
new: i try to change .babelrc to
.babelrc
"plugins": [ "webpack-aliases" ]
it work! ,however i put it in the env as
env
"env": { "test": { "plugins": [ "webpack-aliases" ] } },
it don't work, i add a log in test.js, the process.env.NODE_ENV is test. why it don't work?
process.env.NODE_ENV
test
i think it's not a problem of that repo,so i close it
webpack.config.js:
.babelrc:
xxx.test.js:
when i run with cmd: "set NODE_ENV=test && mocha --compilers js:babel-register test/*/.test.js" the error message is "Cannot find module 'react-df'"
new: i try to change
.babelrc
toit work! ,however i put it in the
env
asit don't work, i add a log in test.js, the
process.env.NODE_ENV
istest
. why it don't work?