Upgraded webpack
This commit is contained in:
parent
869af1f1c5
commit
d1815530aa
7 changed files with 2197 additions and 957 deletions
File diff suppressed because one or more lines are too long
3123
package-lock.json
generated
3123
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -4,7 +4,7 @@
|
||||||
"description": "ISO 639-1 languages and ISO 3166-1 countries translated in 89 languages",
|
"description": "ISO 639-1 languages and ISO 3166-1 countries translated in 89 languages",
|
||||||
"main": "./lib/iso-countries-languages.js",
|
"main": "./lib/iso-countries-languages.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "NODE_ENV=production webpack --progress --optimize-minimize"
|
"build": "NODE_ENV=production webpack --progress"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -13,9 +13,10 @@
|
||||||
"author": "Luca Tagliaferri",
|
"author": "Luca Tagliaferri",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"json-loader": "^0.5.4",
|
"json-loader": "^0.5.7",
|
||||||
"lzstring-loader": "^0.2.0",
|
"lzstring-loader": "^0.2.0",
|
||||||
"webpack": "1.13.3"
|
"webpack": "^4.29.0",
|
||||||
|
"webpack-cli": "^3.2.1"
|
||||||
},
|
},
|
||||||
"dependencies": {}
|
"dependencies": {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,6 @@ for (const lang of supportedLangs) {
|
||||||
obj.countries[lang] = require(`../res/countries/${lang}`);
|
obj.countries[lang] = require(`../res/countries/${lang}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFileSync(`../src/packagedJson.json`,
|
fs.writeFileSync(`../src/packagedJson.json.icl`,
|
||||||
JSON.stringify(obj));
|
JSON.stringify(obj));
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
var packagedJson = JSON.parse(require('lzstring!./packagedJson.json'));
|
var packagedJson = JSON.parse(require('lzstring-loader!./packagedJson.json.icl'));
|
||||||
var supportedLangs = require('json!./supportedLangs.json');
|
var supportedLangs = require('./supportedLangs.json');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of supported languages
|
* Returns the list of supported languages
|
||||||
|
|
|
@ -2,26 +2,23 @@ var path = require('path');
|
||||||
var webpack = require('webpack');
|
var webpack = require('webpack');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
mode: "production",
|
||||||
entry: './src/index.js',
|
entry: './src/index.js',
|
||||||
extensions: ['', '.js', '.json'],
|
resolve: {
|
||||||
|
extensions: [ '.js','.json'],
|
||||||
|
},
|
||||||
output: {
|
output: {
|
||||||
path: './lib',
|
path: path.resolve(__dirname, "lib"), // string
|
||||||
filename: 'iso-countries-languages.js',
|
filename: 'iso-countries-languages.js',
|
||||||
library: 'IsoCountriesLanguages',
|
library: 'IsoCountriesLanguages',
|
||||||
libraryTarget: 'umd'
|
libraryTarget: 'umd'
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|
||||||
],
|
],
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
|
||||||
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
externals: [
|
externals: [
|
||||||
|
|
||||||
],
|
]
|
||||||
resolve: {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue