joaogarin / angular-electron

Angular2 and Electron starter using webpack
149 stars 53 forks source link

Packaging error (re-open) #78

Closed Leonardonline closed 7 years ago

Leonardonline commented 7 years ago

I'm so sorry to reopen this bug, but I had the same error.

image

I get this error running the EXE file of the app. Instead running npm run electron command everythings work fine, also the md-slider.

joaogarin commented 7 years ago

I cant really reproduce this as I have no windows machine. Any chance you can try and find out what the issue is and maybe create a pull request? That would be great.

manxiaoboo commented 7 years ago

Hi,I has a same problem with you. But I found a way to solve it, maybe could help you. Change the file 'package.js'

const DEFAULT_OPTS = {
    dir: './',//src/app
    name: appName,
    asar: shouldUseAsar,
    ignore: [
        '/release',
        '/config',
        '/node_modules'
    ].concat(devDeps.map(name => `/node_modules/${name}($|/)`))
};
Leonardonline commented 7 years ago

@manxiaoboo it works like a charm! Thank you so much!

joaogarin commented 7 years ago

Thanks for the feedback! Will try this to see if it can go into the repository. If it doesn't affect other packaging like OSX.

manxiaoboo commented 7 years ago

This method will pack more files into the program, not the best solution. We should just package the compiled JS files instead of all the source files and configuration files.

zhuzhuojiang commented 7 years ago

should only package the compiled JS files not include ts