tonik / theme

Tonik is a WordPress Starter Theme which aims to modernize, organize and enhance some aspects of WordPress theme development.
http://labs.tonik.pl/theme/
MIT License
1.33k stars 140 forks source link

Wrong directory name of javascript files in app.config.js file causing transpilation to fail #32

Closed msacchetti closed 7 years ago

msacchetti commented 7 years ago

When i run prod/production i get:

ERROR in js/app.js from UglifyJs Unexpected token: name (Pilot) [js/app.js:111,8]

It looks like there are some solutions here, i havent tried any yet. https://github.com/joeeames/WebpackFundamentalsCourse/issues/3

Any advice?

msacchetti commented 7 years ago

On further digging, it looks like babel is not transpiling ES6 -> ES5. My final public build files still have the "let" instead of "var". any ideas?

jedrzejchalubek commented 7 years ago

There is a small error in app.config.js file. We picking up a javascript directory instead of js

Please change in 18 line of your build/app.config.js to this one:

javascript: path.resolve(__dirname, '../resources/assets/js'),

If you are planning to import external libraries as non-transpiled ES6 modules you may need to delete include: config.paths.javascript in build/rules/javascript.js at line 9.

module.exports = {
    test: /\.js$/,
    include: config.paths.javascript, // <- remove this one
    loader: 'babel-loader'
}

I'm gonna address this issue immediately. Thanks for catching this up!

jedrzejchalubek commented 7 years ago

Did that solve your problem?

msacchetti commented 7 years ago

Yes! Thank you