react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

build wpf bundle

Open scott108 opened this issue 9 years ago • 11 comments

hi, when I use react-native bundle --platform wpf --entry-file index.wpf.js --bundle-output wpf\tte\ReactAssets\index.wpf.bundle --assets-dest wpf\tte\ReactAssets
to build index.wpf.bundle, and I got Unrecognized platform: wpf message

scott108 avatar Aug 03 '17 01:08 scott108

Hi @scott108, did you run npm i rnpm-plugin-wpf or yarn add rnpm-plugin-wpf and react-native wpf before trying to run the bundle command?

sayar avatar Aug 04 '17 18:08 sayar

Hi @sayar , I just run npm i rnpm-plugin-windows and react-native wpf, is there anything different??

scott108 avatar Aug 07 '17 06:08 scott108

Yep, you gotta run npm i rnpm-plugin-wpf (note the wpf instead of windows) to be able to add wpf platform support. Let me know if that fixes your problem so I can close this issue.

sayar avatar Aug 07 '17 13:08 sayar

If i only run npm i rnpm-plugin-wpf, and I got Unrecognized command 'wpf' message after react-native wpf(reference #1177) image

scott108 avatar Aug 08 '17 01:08 scott108

@scott108, I wasn't able to reproduce this error. Can you please share what versions of react-native you are using?

sayar avatar Aug 08 '17 14:08 sayar

Hi @sayar, here is my package.json

{
  "name": "test",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.0.0-alpha.12",
    "react-native": "0.47.1"
  },
  "devDependencies": {
    "babel-jest": "20.0.3",
    "babel-preset-react-native": "2.1.0",
    "jest": "20.0.4",
    "react-test-renderer": "16.0.0-alpha.12"
  },
  "jest": {
    "preset": "react-native"
  }
}

scott108 avatar Aug 09 '17 01:08 scott108

You are missing react-native-windows.

npm install --save-dev rnpm-plungin-wpf
npm install --save-dev react-native-windows
react-native wpf

dpitre avatar Sep 18 '17 13:09 dpitre

Can you help me about this issue

Javis1205 avatar Feb 02 '18 01:02 Javis1205

@sayar can you help me?

Javis1205 avatar Feb 02 '18 07:02 Javis1205

In order to create bundle for WPF platform use 'windows' option instead of 'wpf':

react-native bundle --platform **windows** --entry-file **index.js** --bundle-output wpf\samplewpfapp\ReactAssets\index.wpf.bundle --assets-dest wpf\samplewpfapp\ReactAssets

Alter refer:

  1. https://github.com/Microsoft/react-native-windows/issues/1801
  2. https://github.com/Microsoft/react-native-windows/issues/1539

praveen4zenith avatar Jun 05 '18 10:06 praveen4zenith

Looks like @ncomo11 might have the correct solution here. Please advise if this needs to be re-opened.

rozele avatar Jul 23 '18 21:07 rozele