Closed niftylettuce closed 8 years ago
I didn't change anything, i just did a fresh npm install and it stopped working
has something changed with webpack or this rnws package?
@niftylettuce Turns out the RN 0.13 local-cli/cli.js
script behaves a bit differently than in RN 0.14 :expressionless:. Can you try out the rn-0.13-fix
branch and let me know if it works?
I'll just wait for a stable version, just using react native packager for now
I do have the same issue on a fresh RN (0.14.2) project.
My webpack config:
'use strict';
var fs = require('fs');
var path = require('path');
var webpack = require('webpack');
var config = {
debug: true,
devtool: 'source-map',
entry: {
'index.ios': ['./src/app.js'],
'index.android': ['./src/app.js'],
},
output: {
path: path.resolve(__dirname, 'build'),
filename: '[name].js',
},
module: {
loaders: [{
test: /\.js$/,
include: [
path.resolve(__dirname, 'src')
],
loader: 'babel',
query: {
stage: 0,
plugins: []
}
}]
},
plugins: [],
};
// Hot loader
if (process.env.HOT) {
config.devtool = 'eval'; // Speed up incremental builds
config.entry['index.ios'].unshift('react-native-webpack-server/hot/entry');
config.entry['index.ios'].unshift('webpack/hot/only-dev-server');
config.entry['index.ios'].unshift('webpack-dev-server/client?http://localhost:8082');
config.output.publicPath = 'http://localhost:8082/';
config.plugins.unshift(new webpack.HotModuleReplacementPlugin());
config.module.loaders[0].query.plugins.push('react-transform');
config.module.loaders[0].query.extra = {
'react-transform': [{
target: 'react-transform-hmr',
imports: ['react-native'],
locals: ['module']
}]
};
}
// Production config
if (process.env.NODE_ENV === 'production') {
config.plugins.push(new webpack.optimize.OccurrenceOrderPlugin());
config.plugins.push(new webpack.optimize.UglifyJsPlugin());
}
module.exports = config;
My package.json:
{
"name": "AppCompanion",
"version": "0.0.1",
"private": true,
"scripts": {
"bundle": "rnws bundle",
"start": "rnws start"
},
"dependencies": {
"babel": "^5.8.23",
"babel-core": "^5.8.24",
"babel-loader": "^5.3.2",
"react-native": "^0.14.2"
},
"devDependencies": {
"babel-plugin-react-transform": "^1.1.1",
"react-native-webpack-server": "^0.8.1",
"react-transform-hmr": "^0.1.6",
"webpack": "^1.12.6",
"webpack-dev-server": "^1.12.1"
}
}
I can see you merged a PR supposedly fixing that. I guess it is just a matter of time before you release? Downgrading webpack doesn't change anything. I even tried to clone the repo and add RNWS as a module to my project from the local repo, so with the latest changes, and still the same issue.
RN 0.14.2, RNWS 0.8.1
I move index.ios.js from "root/src" to the root of my project, therefore xcode building process will see index.ios.js. After it new errors come. There are troubles with relative paths using for import my modules (i think that root dir and alias not define by my webpack config).
Error
uncaught error Error: UnableToResolveError: Unable to resolve module common/btns/MenuMainBtn from /Users/Edward/Atlas/Application/project/src/common/NavBar.js: Invalid directory /Users/node_modules/common/btns/MenuMainBtn
This is strange, but script search my modules in Users dir instead of searching in project's root dir.
A part of webpack.config.js
resolve: {
root: path.resolve(__dirname, 'src'),
extensions: ['', '.js', '.jsx', '.es6'],
alias: {llm: path.join(__dirname, "/lowlevel-modules")},
}
ugh, what has changed?! Why doesn't this work...