question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add section on renaming "app" folder in docs

See original GitHub issue

I have started to use brunch with the “brunch new” command

This builds fine with brunch build - no errors

However, when I execute the brunch watch --server, I get the errors

Uncaught error: cannot find module 'process' from '/'

and

uncaught error: cannot find module 'initialize' from '/'

I would that thought that these errors should not be in the console

What am I missing / not set up / do not understand 😉 ?

thanks

Environment

  1. Brunch: 2.8.2
  2. Node: v4.2.0
  3. NPM: 3.3.8
  4. Operating system: Ubuntu 16.04

package.json contents

{
  "name": "brunch-app",
  "description": "Description",
  "author": "Your Name",
  "version": "0.1.0",
  "repository": {
    "type": "git",
    "url": ""
  },
  "scripts": {
    "start": "brunch watch --server",
    "build": "brunch build --production"
  },
  "dependencies": {},
  "devDependencies": {
    "auto-reload-brunch": "^2.0.0",
    "brunch": "^2.0.0",
    "clean-css-brunch": "^2.0.0",
    "css-brunch": "^2.0.0",
    "javascript-brunch": "^2.0.0",
    "uglify-js-brunch": "^2.0.0"
  }
}

brunch config contents

module.exports = {

    paths: {
        "public": './dist',
        'watched': ['src/myApp']
    },

    files: {
        javascripts: {
            joinTo: {
                'myApp.js': /^src\/myApp/,
                'vendor.js': /^(?!src\/myApp)/
            }
        },

        stylesheets: {
            joinTo: {
                'myApp.css': /^src\/myApp/,
                'vendor.css': /^(?!src\/myApp)/
            }
        },
        templates: {
            joinTo: 'myApp.js'
        }
    },
    server: {
        port: 3000,
        hostname: '0.0.0.0',
        stripSlashes: true
    }
};

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
jmlscommented, Aug 21, 2016

perfect! - thanks

Is there a “howto” section / wiki anywhere ? For example, if I want to change app to src I have to

  • add src as a “watch” folder in paths (that tidbit is buried in some paragraph)
  • either change all “requires” to src/foo or use namecleaner
  • anything else ?

it would be useful for bruncher noobs to get to grips

6reactions
goshacmdcommented, Aug 21, 2016

To ger rid of the process error, make sure your HTML loads vendor before app.

The default directory for app code is app. In case you want to change that to src but keep requires as initialize instead of src/myApp/initialize, change the config.modules.nameCleaner to replace src/myApp/ to '' (http://brunch.io/docs/config#-modules-)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rename a file, folder, or link in a document library
Click the ellipses (...) to the right of the item name, and then click Rename. Ellipse menu with Rename highlighted. In the Rename...
Read more >
Rename a folder - Files by Google Help
Next to a folder you want to rename, tap the Down arrow . If you don't see the Down arrow , tap List...
Read more >
Multiple File Rename for Google Drive
A free renaming app for Google Drive that provides better way to rename multiple files with fast, easy and minimal operations.
Read more >
How to rename photos, videos, docs, & files on iPhone, iPad
Tap & hold over a file or folder and pick Rename from the menu. Type the new name and hit done on your...
Read more >
Add, Share, Move, Rename, Download Content Folders - How ...
Right-click on any folder in the library navigation tree on the left, and select Create folder. Right-click on the dashboard on the right...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found