Skip to content

Commit

Permalink
Merge pull request #165 from takenet/fix/fixing-webpack-version
Browse files Browse the repository at this point in the history
fix(webpack): returning webpack version
  • Loading branch information
lucasMurtaVI authored Jun 2, 2023
2 parents cadc8a8 + 641957e commit 56d0dda
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 87 deletions.
41 changes: 20 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,23 @@
},
"homepage": "https://github.com/takenet/blip-components#readme",
"devDependencies": {
"cz-customizable": "^5.3.0",
"cz-customizable-ghooks": "^1.5.0",
"ghooks": "^2.0.4",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"tslint": "5.12.0",
"typescript": "3.2.2",
"url-loader": "1.0.1",
"webpack": "4.8.1",
"webpack-cli": "2.1.3",
"webpack-dev-server": "^3.1.4",
"@types/angular": "1.6.45",
"@types/angular-translate": "^2.16.0",
"@types/angular-ui-router": "^1.1.40",
"@types/node": "14.14.20",
"@types/webpack": "^4.4.24",
"babel-preset-env": "^1.1.8",
"babel-preset-es2015": "^6.18.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-plugin-dynamic-import-webpack": "^1.0.2",
Expand All @@ -34,35 +46,22 @@
"babel-plugin-transform-exponentiation-operator": "^6.8.0",
"babel-plugin-transform-object-rest-spread": "^6.16.0",
"babel-plugin-transform-regenerator": "^6.16.1",
"babel-preset-env": "^1.1.8",
"babel-preset-es2015": "^6.18.0",
"commitizen": "^2.10.1",
"css-loader": "0.26.1",
"cz-conventional-changelog": "^2.1.0",
"cz-customizable": "^5.3.0",
"cz-customizable-ghooks": "^1.5.0",
"extract-text-webpack-plugin": "^4.0.0-alpha.0",
"file-loader": "^3.0.1",
"fork-ts-checker-webpack-plugin": "0.5.2",
"ghooks": "^2.0.4",
"html-loader": "0.5.5",
"html-webpack-plugin": "^2.30.1",
"loader-utils": "^1.0.0",
"mini-css-extract-plugin": "^0.4.0",
"html-webpack-plugin": "^2.26.0",
"css-loader": "0.26.1",
"sass-loader": "7.1.0",
"node-sass": "4.14.1",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"style-loader": "0.13.1",
"raw-loader": "^3.0.0",
"resolve-url-loader": "2.3.0",
"sass": "^1.60.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.13.1",
"ts-loader": "5.3.3",
"tslint": "5.12.0",
"typescript": "3.2.2",
"url-loader": "1.0.1",
"webpack": "4.8.1",
"webpack-cli": "2.1.3",
"webpack-dev-server": "^3.1.4"
"mini-css-extract-plugin": "^0.4.0",
"cz-conventional-changelog": "^2.1.0",
"extract-text-webpack-plugin": "^4.0.0-alpha.0",
"loader-utils": "^1.0.0"
},
"dependencies": {
"angular-sanitize": "^1.8.2",
Expand Down
153 changes: 87 additions & 66 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
const path = require("path");
const webpack = require("webpack");
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const path = require('path')
const webpack = require('webpack')
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')

const cssPlugin = new MiniCssExtractPlugin({
filename: "blip-components.css"
});
filename: 'blip-components.css',
})

module.exports = function() {
return {
mode: "none",
mode: 'none',
entry: {
components: "index",
events: "events",
templates: "templates",
EventEmitter: "shared/EventEmitter"
'components': 'index',
'events': 'events',
'templates': 'templates',
'EventEmitter': 'shared/EventEmitter',
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].js",
libraryTarget: "commonjs2"
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
libraryTarget: 'commonjs2'
},
optimization: {
minimizer: [new OptimizeCSSAssetsPlugin({})]
Expand All @@ -30,137 +30,158 @@ module.exports = function() {
rules: [
{
test: /\.js$/,
loader: "babel-loader",
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: "ts-loader",
options: {
transpileOnly: true
}
}
]
use: [{
loader: 'ts-loader',
options: {
transpileOnly: true,
},
}],
},
{
test: /\.(jpe?g|gif|png|cur)$/i,
use: [
{
loader: "url-loader",
loader: 'url-loader',
options: {
limit: 8192,
name: "img/[name].[ext]?[hash]"
name: 'img/[name].[ext]?[hash]'
}
}
],
exclude: {
test: path.resolve(__dirname, "src/assets/fonts")
}
test: path.resolve(__dirname, 'src/assets/fonts'),
},
},
{
test: /\.(jpe?g|woff|woff2|eot|ttf|gif|png|cur|svg)$/i,
use: [
{
loader: "url-loader",
loader: 'url-loader',
options: {
limit: 8192,
name: "fonts/[name].[ext]?[hash]"
name: 'fonts/[name].[ext]?[hash]'
}
}
],
include: {
test: path.resolve(__dirname, "src/assets/fonts")
}
test: path.resolve(__dirname, 'src/assets/fonts'),
},
},
{
test: /.*(?<!-icon)\.svg$/,
use: [
{
loader: "url-loader",
loader: 'url-loader',
options: {
limit: 1024,
name: "assets/[name].[ext]?[hash]"
}
}
name: 'assets/[name].[ext]?[hash]'
},
},
],
include: {
test: path.resolve(__dirname, "src/"),
test: path.resolve(__dirname, 'src/'),
exclude: {
test: path.resolve(__dirname, "src/assets/fonts")
test: path.resolve(__dirname, 'src/assets/fonts'),
}
}
},
{
test: /.*-icon\.svg$/i,
use: [
{
loader: "raw-loader"
}
loader: 'raw-loader'
},
],
include: {
test: path.resolve(__dirname, "src/"),
test: path.resolve(__dirname, 'src/'),
exclude: {
test: path.resolve(__dirname, "src/assets/fonts")
test: path.resolve(__dirname, 'src/assets/fonts'),
}
}
},
{
test: /\.scss$/,
exclude: /node_modules/,
use: ["style-loader", "css-loader", "sass-loader"]
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader']
},
{
test: /^((?!\.module).)*scss$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader'
],
exclude: /node_modules/
},
{
test: /\.module.scss$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
modules: true,
localIdentName:
'[name]__[local]__[hash:base64:5]'
}
},
'sass-loader'
],
exclude: /node_modules/
},
{
test: /\.html$/,
use: [
{
loader: "html-loader",
loader: 'html-loader',
options: {
exportAsEs6Default: true,
root: path.resolve(__dirname, "src"),
attrs: [":src", ":href", ":xlink:href"]
root: path.resolve(__dirname, 'src'),
attrs: [':src', ':href', ':xlink:href'],
}
}
]
}
]
},
resolve: {
extensions: [".webpack.js", ".web.js", ".js", ".html", ".ts"],
modules: [path.resolve(__dirname, "src"), "node_modules"],
extensions: ['.webpack.js', '.web.js', '.js', '.html', '.ts'],
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
alias: {
assets: path.resolve(__dirname, "src/assets")
}
assets: path.resolve(__dirname, 'src/assets'),
},
},
devServer: {
contentBase: path.join(__dirname, "dist"),
contentBase: path.join(__dirname, 'dist'),
watchContentBase: true,
inline: true,
compress: true
compress: true,
},
externals: {
blipToolkit: "blip-toolkit",
angular: "angular",
moment: "moment",
"angular-translate": "angular-translate",
"angular-translate-storage-cookie":
"angular-translate-storage-cookie",
fecha: "fecha"
blipToolkit: 'blip-toolkit',
angular: 'angular',
moment: 'moment',
'angular-translate': 'angular-translate',
'angular-translate-storage-cookie': 'angular-translate-storage-cookie',
fecha: 'fecha'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.LoaderOptionsPlugin({
debug: true
}),
new ForkTsCheckerWebpackPlugin({
tslint: "./tslint.json",
tsconfig: "./tsconfig.json",
watch: "./src/**/*.ts",
tslint: './tslint.json',
tsconfig: './tsconfig.json',
watch: './src/**/*.ts',
async: false
}),
cssPlugin
]
};
};
}
}

0 comments on commit 56d0dda

Please sign in to comment.