Wednesday, 17 May 2017

Couldn't find preset "transform-decorators-legacy" relative to directory

I am trying to use the @ notation that apparently is not supported yet. So I am trying to use "transform-decorators-legacy" but when I try to compile my app via "npm run dev"

I get

ERROR in ./src/app.js
Module build failed: Error: Couldn't find preset "transform-decorators-legacy" relative to directory "Test"
    at node_modules\babel-core\lib\transformation\file\options\option-manager.js:293:19
    at Array.map (native)
    at OptionManager.resolvePresets (node_modules\babel-core\lib\transformation\file\options\option-manager.js:275:20)
    at OptionManager.mergePresets (node_modules\babel-core\lib\transformation\file\options\option-manager.js:264:10)
    at OptionManager.mergeOptions (node_modules\babel-core\lib\transformation\file\options\option-manager.js:249:14)
    at OptionManager.init (node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)
    at File.initOptions (node_modules\babel-core\lib\transformation\file\index.js:212:65)
    at new File (node_modules\babel-core\lib\transformation\file\index.js:135:24)
    at Pipeline.transform (node_modules\babel-core\lib\transformation\pipeline.js:46:16)
    at transpile (node_modules\babel-loader\lib\index.js:48:20)
    at Object.module.exports (node_modules\babel-loader\lib\index.js:163:20)

Babelrc

{
    "presets": ["transform-decorators-legacy", "stage-0", "es2015", "react", "transform-decorators"]
}

Webpack

module.exports = {
    entry: './src/app.js',
    output: {
        filename: './dist/app.bundle.js'
    },
   module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                loader: "babel-loader"
            }
        ]
    }

}

package.json

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "webpack -d --watch",
    "prod": "webpack -p "
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "babel-core": "^6.24.1",
    "babel-loader": "^7.0.0",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-preset-stage-0": "^6.24.1",
    "mobx": "^3.1.9",
    "mobx-react": "^4.1.8",
    "react": "^15.5.4",
    "react-dom": "^15.5.4",
    "webpack": "^2.5.1"
  }
}



via chobo2

No comments:

Post a Comment