Skip to content

Commit

Permalink
update webpack configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
crabbly committed Aug 18, 2018
1 parent 7df4dd3 commit 62ae193
Show file tree
Hide file tree
Showing 6 changed files with 4,372 additions and 24 deletions.
4 changes: 0 additions & 4 deletions mix-manifest.json

This file was deleted.

24 changes: 15 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@
"license": "MIT",
"dependences": {},
"devDependencies": {
"cross-env": "^3.2.3",
"laravel-mix": "^0.8.3",
"standard": "^7.1.2"
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"css-loader": "^1.0.0",
"mini-css-extract-plugin": "^0.4.1",
"node-sass": "^4.9.3",
"sass-loader": "^7.1.0",
"standard": "^7.1.2",
"uglifyjs-webpack-plugin": "^1.3.0",
"webpack": "^4.16.5",
"webpack-cli": "^3.1.0"
},
"scripts": {
"test": "standard",
"dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
"dev": "webpack --mode development --progress --hide-modules",
"watch": "webpack --mode development --watch --progress --hide-modules",
"production": "webpack --mode production --progress --hide-modules"
},
"author": "Rodrigo Vieira <rodrigo@crabbly.com>",
"standard": {
Expand All @@ -28,6 +33,7 @@
},
"keywords": [
"printjs",
"print.js"
"print.js",
"print-js"
]
}
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import css from './sass/index.scss'
import print from './js/init'

const printjs = print.init
Expand Down
56 changes: 56 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const path = require('path')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const MiniCssExtractPlugin = require("mini-css-extract-plugin")

module.exports = {
entry: [
'./src/index.js'
],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'print.min.js',
sourceMapFilename: 'print.map'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /\.scss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
sourceMap: true
}
},
{
loader: 'css-loader',
options: {
sourceMap: true
}
},
{
loader: 'sass-loader',
options: {
sourceMap: true
}
}
],
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: 'print.min.css'
}),
new UglifyJSPlugin({
sourceMap: true
})
]
}
11 changes: 0 additions & 11 deletions webpack.mix.js

This file was deleted.

Loading

0 comments on commit 62ae193

Please sign in to comment.