Skip to content
Snippets Groups Projects
Commit 1fed2a6c authored by Markin Igor's avatar Markin Igor
Browse files

Allow CORS for dev mode.

parent 1bff4e84
No related branches found
No related tags found
1 merge request!4Use webpack for bundling JS libs and move Golang code related to Iframe generation there
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
"@babel/preset-env": "^7.1.0", "@babel/preset-env": "^7.1.0",
"babel-loader": "^8.0.4", "babel-loader": "^8.0.4",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"clean-webpack-plugin": "^0.1.19",
"core-js": "^2.5.7", "core-js": "^2.5.7",
"html-webpack-inline-source-plugin": "^0.0.10", "html-webpack-inline-source-plugin": "^0.0.10",
"html-webpack-plugin": "^3.2.0", "html-webpack-plugin": "^3.2.0",
......
...@@ -8,7 +8,10 @@ module.exports = merge(common, { ...@@ -8,7 +8,10 @@ module.exports = merge(common, {
devServer: { devServer: {
contentBase: './dist', contentBase: './dist',
// hot: true, // hot: true,
port: 9000 port: 9000,
headers: {
'Access-Control-Allow-Origin': '*'
}
}, },
plugins: [ plugins: [
new webpack.NamedModulesPlugin(), new webpack.NamedModulesPlugin(),
......
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin'); const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin')
module.exports = { module.exports = {
entry: { entry: {
...@@ -13,6 +14,7 @@ module.exports = { ...@@ -13,6 +14,7 @@ module.exports = {
chunks: ['viamapi-iframe'], chunks: ['viamapi-iframe'],
inlineSource: '.(js)$' inlineSource: '.(js)$'
}), }),
new CleanWebpackPlugin(),
new HtmlWebpackInlineSourcePlugin() new HtmlWebpackInlineSourcePlugin()
], ],
module: { module: {
......
...@@ -1139,6 +1139,12 @@ clean-css@4.2.x: ...@@ -1139,6 +1139,12 @@ clean-css@4.2.x:
dependencies: dependencies:
source-map "~0.6.0" source-map "~0.6.0"
clean-webpack-plugin@^0.1.19:
version "0.1.19"
resolved "https://registry.yarnpkg.com/clean-webpack-plugin/-/clean-webpack-plugin-0.1.19.tgz#ceda8bb96b00fe168e9b080272960d20fdcadd6d"
dependencies:
rimraf "^2.6.1"
cliui@^3.2.0: cliui@^3.2.0:
version "3.2.0" version "3.2.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment