Giter VIP home page Giter VIP logo

webpack-starter's Introduction

Webpack Frontend Starterkit

A lightweight foundation for your next webpack based frontend project.

Installation

npm install

Start Dev Server

npm start

Build Prod Version

npm run build

Features:

When you run npm run build we use the mini-css-extract-plugin to move the css to a separate file. The css file gets included in the head of the index.html.

webpack-starter's People

Contributors

anatoly314 avatar armaniela avatar dependabot-preview[bot] avatar dependabot[bot] avatar g-div avatar greenkeeper[bot] avatar moklick avatar narrator0 avatar niklasp avatar soroushj avatar stefankeil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webpack-starter's Issues

Include purge css

Please include purge css in the config or provide the procedure for adding autoprefixer, cssnano and purge css for production build.

An in-range update of clean-webpack-plugin is breaking the build 🚨

The devDependency clean-webpack-plugin was updated from 2.0.1 to 2.0.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

clean-webpack-plugin is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 7 commits.

  • 9e23e7b bumped version to 2.0.2
  • 5415087 Merge pull request #137 from chrisblossom/options-partial
  • 18f71a5 replace Partial with explicit optional options
  • 4f8ae44 Merge pull request #135 from chrisblossom/export-options
  • b9b35f8 export Options type
  • 9f8a3bb Merge pull request #113 from mkungla/patch-1
  • 8fbf1f4 Remove duplicate dry from readme

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

NPM vulnerabilities

When installing dependencies trough npm you get the message: found 74 high severity vulnerabilities.

This can be fixed with a fairly simple update to the package-lock.json.

Will provide fixing pull request so you can check

Point of public folder(s)?

Hi,

I was wondering what the advantage/logic is behind having a folder called "public" with an empty .gitkeep file inside. I found this public folder inside the starter zip and inside the "build" folder after running "npm run build".

After some googling and looking through the configs I still couldn't figure out why they are there. Would love to know.

Thanks!

npm run build doesn't work

When I run command 'npm run build' nothing happens. I don't see any errors, but the public directory is empty. It happens also on empty and fresh template.

An in-range update of babel7 is breaking the build 🚨

There have been updates to the babel7 monorepo:

    • The devDependency @babel/core was updated from 7.4.3 to 7.4.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Failing to load SVG's

Fails to load in SVG's for me.
I've added the following into webpack.config.helper.js in the rules section.

{
      test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
      loader: 'url-loader'
}

And getting You may need an appropriate loader to handle this file type. on all the SVG types. Any suggestions?

Promise undefined

Hello,
I am getting promise undefined error on IE11. I have installed core-js (v3) and imported it in my entry js file but the error is still there.

Why index.js is executed

Hi, can you please tell me when we do
npm start
index.js is executed? It is not referenced in index.html, so what is making it getting executed?
I added a ne js file in src/scripts but it does not get executed
Thanks

High severity vulnerabilities

To reproduce just clone the master branch then run:

npm install

You should receive the message:

found 2 high severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details

Then after running npm fix audit

+ [email protected]
removed 3 packages and updated 3 packages in 109.493s
fixed 2 of 2 vulnerabilities in 11519 scanned packages

So I think you should update your package.json to take this into account.

loading fonts

This is a great starterkit, however I seem to have problems loading fonts. When I try to load a font in my src directory I encounter an error:

ERROR in ./node_modules/css-loader?sourceMap=true!./node_modules/sass-loader/lib/loader.js!./src/styles/index.scss
Module not found: Error: Can't resolve './assets/digital-7.ttf' in '/Users/AlexanderFallenstedt/Code/personal/threejs-solar-system/src/styles'
 @ ./node_modules/css-loader?sourceMap=true!./node_modules/sass-loader/lib/loader.js!./src/styles/index.scss 6:80-113
 @ ./src/styles/index.scss
 @ ./src/scripts/index.js
 @ multi (webpack)-dev-server/client?http://localhost:1337 webpack/hot/dev-server ./src/scripts/index

How I am attempting to load the font:

@font-face {
  font-family: digital;
  src: url('./assets/digital-7.ttf');
}
h1 {
  font-family: digital;
}

I'm going through your webpack.config-helper.js however I'm unsure what plugin is needed if any.

Syntax Error in chunk.js in IE11

Our app is choking when we load it up in IE 11. We are getting SCRIPT1002: Syntax error on the chunk.js file. It is having trouble with multiple things in that file. What are we missing for Babel to transpose all that to es5?

chunkjs.txt

.babelrc

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "useBuiltIns": "usage",
        "corejs": "3.0.0"
      }
    ]
  ],
  "plugins": [
    "@babel/plugin-syntax-dynamic-import",
    "@babel/plugin-proposal-class-properties",
    "@babel/plugin-transform-runtime"
  ]
}

webpack.common.js

const Path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  entry: {
    app: Path.resolve(__dirname, '../src/scripts/index.js')
  },
  externals: {
    // jQuery: 'jQuery',
    foundation: 'Foundation'
  },
  output: {
    path: Path.join(__dirname, '../build'),
    filename: 'js/[name].js'
  },
  optimization: {
    splitChunks: {
      chunks: 'all',
      name: false
    }
  },
  plugins: [
    new CleanWebpackPlugin(),
    new CopyWebpackPlugin([
      { from: Path.resolve(__dirname, '../public'), to: 'public' }
    ]),
    new HtmlWebpackPlugin({
      template: Path.resolve(__dirname, '../src/index.html')
    })
  ],
  resolve: {
    alias: {
      '~': Path.resolve(__dirname, '../src')
    }
  },
  module: {
    rules: [
      {
        test: /\.mjs$/,
        include: /node_modules/,
        type: 'javascript/auto'
      },
      {
        test: /\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)(\?.*)?$/,
        use: {
          loader: 'file-loader',
          options: {
            name: '[path][name].[ext]'
          }
        }
      },
    ]
  },
  
};

webpack.config.dev.js

const Path = require('path');
const Webpack = require('webpack');
const merge = require('webpack-merge');
const common = require('./webpack.common.js');

module.exports = merge(common, {
  mode: 'development',
  devtool: 'cheap-eval-source-map',
  output: {
    chunkFilename: 'js/[name].chunk.js'
  },
  devServer: {
    inline: true
  },
  plugins: [
    new Webpack.DefinePlugin({
      'process.env.NODE_ENV': JSON.stringify('development')
    }),
    new Webpack.ProvidePlugin({
        $: "jquery",
        jQuery: "jquery"
    })
  ],
  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        include: Path.resolve(__dirname, '../src'),
        enforce: 'pre',
        loader: 'eslint-loader',
        options: {
          emitWarning: true, 
        }
      },
      {
        test: /\.js?x?$/,
        include: Path.resolve(__dirname, '../src'),
        exclude: /node_modules\/(?![gsap\-es|lodash\-es])/,
        loader: 'babel-loader',
        query: {
          "presets": ["@babel/preset-env", "@babel/preset-react"],
        }
      },
      {
        test: /\.s?css$/i,
        use: ['style-loader', 'css-loader?sourceMap=true', 'sass-loader']
      },
    ],
  },
});

webpack.config.prod.js

const Webpack = require('webpack');
const merge = require('webpack-merge');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const common = require('./webpack.common.js');

module.exports = merge(common, {
  mode: 'production',
  // devtool: 'source-map',
  stats: 'errors-only',
  bail: true,
  output: {
    // filename: 'js/[name].[chunkhash:8].js',
    // chunkFilename: 'js/[name].[chunkhash:8].chunk.js'
    filename: 'js/[name].js',
    chunkFilename: 'js/chunk.js'
  },
  plugins: [
    new Webpack.DefinePlugin({
      'process.env.NODE_ENV': JSON.stringify('production')
    }),
    new Webpack.optimize.ModuleConcatenationPlugin(),
    new Webpack.ProvidePlugin({
      $: "jquery",
      jQuery: "jquery"
  }),
    new MiniCssExtractPlugin({
      filename: 'bundle.css'
    }),
  ],
  module: {
    rules: [
      {
        test: /\.js?x?$/,
        exclude: /node_modules\/(?![gsap\-es|lodash\-es])/,
        loader: 'babel-loader',
        query: {
          "presets": ["@babel/preset-env", "@babel/preset-react"],
        }
      },
      {
        test: /\.s?css/i,
        use : [
          MiniCssExtractPlugin.loader,
          'css-loader',
          'sass-loader'
        ]
      }
    ]
  }
});

browserslistrc

[production staging]
>5%
last 2 versions
Firefox ESR
not ie < 11

[development]
last 1 chrome version
last 1 firefox version
last 1 edge version

npm start not loading scss file

I would like to do "npm start" and then view the scss file being compiled, is this not possible?
I get this error message:

ERROR in ./src/scripts/index.js
Module build failed (from ./node_modules/eslint-loader/index.js):
Error: No ESLint configuration found.

I thought this repo would have everything needed to run sass in dev mode?

An in-range update of webpack is breaking the build 🚨

The devDependency webpack was updated from 4.35.3 to 4.36.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

webpack is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v4.36.0

Features

  • SourceMapDevToolPlugin append option now supports the default placeholders in addition to [url]
  • Arrays in resolve and parser options (Rule and Loader API) support backreferences with "..." when overriding options.
Commits

The new version differs by 42 commits.

  • 95d21bb 4.36.0
  • aa1216c Merge pull request #9422 from webpack/feature/dot-dot-dot-merge
  • b3ec775 improve merging of resolve and parsing options
  • 53a5ae2 Merge pull request #9419 from vankop/remove-valid-jsdoc-rule
  • ab75240 Merge pull request #9413 from webpack/dependabot/npm_and_yarn/ajv-6.10.2
  • 0bdabf4 Merge pull request #9418 from webpack/dependabot/npm_and_yarn/eslint-plugin-jsdoc-15.5.2
  • f207cdc remove valid jsdoc rule in favour of eslint-plugin-jsdoc
  • 31333a6 chore(deps-dev): bump eslint-plugin-jsdoc from 15.3.9 to 15.5.2
  • 036adf0 Merge pull request #9417 from webpack/dependabot/npm_and_yarn/eslint-plugin-jest-22.8.0
  • 37d4480 Merge pull request #9411 from webpack/dependabot/npm_and_yarn/simple-git-1.121.0
  • ce2a183 chore(deps-dev): bump eslint-plugin-jest from 22.7.2 to 22.8.0
  • 0beeb7e Merge pull request #9391 from vankop/create-hash-typescript
  • bf1a24a #9391 resolve super call discussion
  • bd7d95b #9391 resolve discussions, AbstractMethodError
  • 4190638 chore(deps): bump ajv from 6.10.1 to 6.10.2

There are 42 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Not resolving image path in HTML inline style

I'm trying to load a background image like so:
<div class="page-header" style="background-image: url('./img/background.jpg')">
but I get a 404 on the image url. The img folder is inside src.
I've also tried writing it like this url('~img/background.jpg') but I get the same result. Can you please let me know how I can solve this? Thanks!

Including multiple JS files in project

Hi all,
I new to webpack and this starter template and am trying to include multiple JS files as part of my project along side index.js. How does importing work in this repository? Can I still import via a CDN in the HTML?

npm start -> npm run start

I'm a first timer in this and found that npm run start gave me the dev server, not npm run:

package.json:
"scripts": {
"build": "cross-env NODE_ENV=production webpack --config webpack/webpack.config.prod.js --colors",
"start": "webpack-dev-server --open --config webpack/webpack.config.dev.js"
},

Please verify your instructions in README.md and adjust accordingly if I'm correct.

error on npm install (primordials is not defined)

Hello, I am having an issue running npm install. Is this related to webpack-starter?

$ npm install
npm ERR! Windows_NT 10.0.18362
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Mike\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v12.16.2
npm ERR! npm v3.6.0

npm ERR! primordials is not defined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! C:\users\mike\jsdev\webpack-starter\npm-debug.log

Thank you!

Open Chrome or edge instead of IE

Hi, I have Chrome and Edge on my win10 box. When I do npm start, it luaunches IE instead of those 2 browsers.
After googling, I adde a bs-config.json in the root, restart, still opens IE11
Thanks

CSS injected lately during development phase

Hello,
Is there a way to inject CSS directly in the HTML instead using Javascript to load it?
During development on page refresh all elements get displayed "unstyled" for few seconds.
Thanks

Your .dependabot/config.yml contained invalid details

Dependabot encountered the following error when parsing your .dependabot/config.yml:

Automerging is not enabled for this account. You can enable it from the [account settings](https://app.dependabot.com/accounts/wbkd/settings) screen in your Dependabot dashboard.

Please update the config file to conform with Dependabot's specification using our docs and online validator.

eslint error - Missing semicolon - semi config is ignored

i removed .eslintrc in favor of .eslintrc.js
but eslint ignores my relaxed semicolon config

the config propagates to node_modules/eslint/lib/rules/semi.js
where options.omitLastInOneLineBlock is true
but still, it has no effect,
or there is a second pass of eslint that ignores my config

im stuck, please help : /

// .eslintrc.js

// debug
console.log('hello from .eslintrc.js');

module.exports = {
  rules: {
    // relaxed semicolon config
    semi: ["error", "always", { omitLastInOneLineBlock: true }],
  }
}

this .eslintrc is also ignored:

{
  "rules": {
    "semi": ["error", "always", { "omitLastInOneLineBlock": true }]
  }
}
// src/scripts/index.js

console.log('hello')
//                  ^ eslint error
console.log('world')
//                  ^ eslint error
cd /tmp
git clone --depth=1 https://github.com/wbkd/webpack-starter.git
cd webpack-starter
npm install
rm .eslintrc
cp /tmp/.eslintrc.js .
cp /tmp/index.js src/scripts/index.js
npm run start 

> [email protected] start /tmp/webpack-starter
> webpack-dev-server --open --config webpack/webpack.config.dev.js

ℹ 「wds」: Project is running at http://localhost:8081/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /tmp/webpack-starter
hello from .eslintrc.js
ℹ 「wdm」: wait until bundle finished: /
⚠ 「wdm」: Hash: db6471af805096a10c6e
Version: webpack 4.41.4
Time: 3418ms
Built at: 12/25/2019 3:47:05 PM
          Asset       Size  Chunks             Chunk Names
     index.html  382 bytes          [emitted]  
  js/0.chunk.js    904 KiB       0  [emitted]  
      js/app.js   14.2 KiB     app  [emitted]  app
public/.gitkeep    0 bytes          [emitted]  
Entrypoint app = js/0.chunk.js js/app.js
[0] multi (webpack)-dev-server/client?http://localhost:8081 ./src/scripts/index.js 40 bytes {app} [built]
[.... modules built ....]
    + 22 hidden modules

WARNING in ./src/scripts/index.js
Module Warning (from ./node_modules/eslint-loader/dist/cjs.js):

/tmp/webpack-starter/src/scripts/index.js
  5:21  error  Missing semicolon  semi
  6:21  error  Missing semicolon  semi

✖ 2 problems (2 errors, 0 warnings)
  2 errors and 0 warnings potentially fixable with the `--fix` option.

Child HtmlWebpackCompiler:
     1 asset
    Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
    [./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html] 552 bytes {HtmlWebpackPlugin_0} [built]
ℹ 「wdm」: Compiled with warnings.

missing string-width dependencies

image

When run npm run dev got errors !

> webpack-dev-server --open --config webpack-dev.config.js --watch --colors

module.js:471
    throw err;
    ^

Error: Cannot find module 'string-width'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (...)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `webpack-dev-server --open --config webpack-dev.config.js --watch --colors`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     ....log

To fix this, need add "string-width": "^2.1.1" dependencies to package.json file.

Build not starting

Hi

When trying to build a project, the build doesn't seem to start.
@ First I couldn't star the build. I needed to put the 'set' command before NODE_ENV in the build script. Afterwards I could run the command 'npm run build' but the the process only starts for a split second. There's no build folder, but also no error message.

Any advice? Keep up the good work with this repo! I'm using it quite a lot

Cheerz

An in-range update of copy-webpack-plugin is breaking the build 🚨

The devDependency copy-webpack-plugin was updated from 5.0.2 to 5.0.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

copy-webpack-plugin is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v5.0.3

5.0.3 (2019-04-24)

Bug Fixes

  • alone [N] interpolation in to option (#375) (70917b7)
Commits

The new version differs by 3 commits.

  • ec0e036 chore(release): 5.0.3
  • de52b48 chore(defaults): update (#376)
  • 70917b7 fix: alone [N] interpolation in to option (#375)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

CSS is loaded too late

The best you can see it when you keep reloading the page and for some milliseconds the "webpack starter" text stays black until css is loaded.

An in-range update of webpack-cli is breaking the build 🚨

The devDependency webpack-cli was updated from 3.3.1 to 3.3.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

webpack-cli is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 17 commits.

  • f0031fd chore: v.3.3.2
  • 0309e37 Merge pull request #863 from misterdev/feat/option-to-disable-postinstall
  • c833961 Merge pull request #876 from misterdev/fix-opencollective-eperm
  • b4dfa17 Merge branch 'master' into feat/option-to-disable-postinstall
  • e241b7b chore(docs): Refactors links for badges (#859)
  • 5284b7e fix(opencollective-prompt): check write permissions
  • e17a26d misc(opencollective-prompt): improve grammar
  • 246db42 fix(opencollective prompt): fix grammar
  • d4643ae feat(opencollective prompt): add option to disable it + doc
  • d16404a chore(deps): fix security vulnerabilities (#857)
  • c910463 chore(types): move to @types/yeoman-generator (#869)
  • 68b674b chore(docs): minor fixes in the docs (#874)
  • 7883871 docs: code of conduct (#873)
  • 129a07a chore(travis): removed stable (#871)
  • 309cc1c docs(contribute): adds table of contents and info about dependencies. (#842)

There are 17 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Um, how do I access images / assets?

I'm probably missing something simple, but I can't seem to find my assets (images/ video). Is Webpack in Dev moving the HTML somewhere? Thanks.

npm start not working for webpack-dev-server

After cloning this repo and doing npm install. When I did npm start. My webpack-dev-server does not start, instead, it gives the below error. What could be the issue for this error?

[email protected] start D:\D-Drive\WebDevelopment\JavaScript\Pluralsight\JavaScript-Fundamentals\webpack-starter

webpack-dev-server --open --config webpack/webpack.config.dev.js

i 「wds」: Project is running at http://localhost:8080/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from D:\D-Drive\WebDevelopment\JavaScript\Pluralsight\JavaScript-Fundamentals\webpack-starter
events.js:174
throw er; // Unhandled 'error' event
^

Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: webpack-dev-server --open --config webpack/webpack.config.dev.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

Async Functions / Promises

Hello,
is it possible to add support for async functions to the webpack config?

I've found some approaches on how to add it, but couldn't figure it out:
https://medium.com/@tanbt/configure-async-await-es7-in-webpack-4-78adfda46eac

Basically you add this to the entry:
entry: ["@babel/polyfill", "./src/app.js"],

But i can't get it to work. I'd like to be able to run stuff like:

async function hello() { return "Hello" };
hello().then((value) => console.log(value))

Thank you!

Security vulnerabilities

There are some security vulnerabilities at install. It would be nice if these could be resolved.

npm error messages

I am using visual code as my editor. I copied your link and downloaded everything through my cmd prompt (windows). I tried installing everything and I am getting an error message when I use npm run dev to start up the server. I also tried using npm start and still keep getting the error message saying "scripts missing" or what not. Could you please help me fix the issue. I am doing a tutorial through plural sight and working of course with java script. Thank you for your help.

SyntaxError: Unexpected token =>

I'm trying to get up and running with this kit. I copied the contents of this repo into my own, and I'm running into the following errors after npm install and npm run dev:

/Users/cklimkow/workspace/js-lightbox/webpack.config-helper.js:3
const Path = require('path')
^^^^^
SyntaxError: Use of const in strict mode.
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/cklimkow/workspace/js-lightbox/webpack-dev.config.js:1:80)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

This one is easy enough to fix, just remove 'use strict'; from webpack.config-helper.js

Then, I'm now running into this issue:

/Users/cklimkow/workspace/js-lightbox/webpack.config-helper.js:9
module.exports = (options) => {
                           ^^
SyntaxError: Unexpected token =>
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/cklimkow/workspace/js-lightbox/webpack-dev.config.js:1:80)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

But I don't have a quick solution to this one. I was hoping this kit would be a quick drag-and-drop solution. Help?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.