Skip to content

Instantly share code, notes, and snippets.

@kasiriveni
Created June 12, 2017 17:06
Show Gist options
  • Save kasiriveni/9f7158cff5995ffefb6ad76f3aac99fc to your computer and use it in GitHub Desktop.
Save kasiriveni/9f7158cff5995ffefb6ad76f3aac99fc to your computer and use it in GitHub Desktop.
import jquery from 'jquery';
import'./style.css';
console.log(jquery.fn.jquery)
console.log($.fn.jquery)
console.log(jQuery.fn.jquery)
{
"name": "41167623",
"version": "1.0.0",
"description": "Parse Error in webpack's package.json",
"main": "main.js",
"scripts": {
"start": "webpack"
},
"author": "",
"license": "ISC",
"devDependencies": {
"css-loader": "^0.28.4",
"jquery": "^3.2.1",
"style-loader": "^0.18.2",
"webpack": "^2.6.1"
}
}
body {
background-color: green;
font-family:Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
}
const webpack = require("webpack");
const path = require('path');
module.exports = {
entry: "./main.js",
output: {
path: path.resolve(__dirname, 'build'),
filename: "bundle.js"
},
module: {
rules: [
{
test: /\.css$/,
use: [
{ loader: "style-loader" },
{ loader: "css-loader" }
]
}
]
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
]
};
@kasiriveni
Copy link
Author

Do the steps

 npm install 
npm start 

@kasiriveni
Copy link
Author

image

Output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment