代码拉取完成,页面将自动刷新
// Note to editors, if you change this file you have to restart compile-webviews.
// It doesn't reload the config otherwise.
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const FixDefaultImportPlugin = require('webpack-fix-default-import-plugin');
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin')
const configFileName = 'tsconfig.datascience-ui.json';
module.exports = [
{
entry: ['babel-polyfill', './src/datascience-ui/history-react/index.tsx'],
output: {
path: path.join(__dirname, 'out'),
filename: 'datascience-ui/history-react/index_bundle.js',
publicPath: './'
},
mode: 'development', // Leave as is, we'll need to see stack traces when there are errors.
// Use 'eval' for release and `eval-source-map` for development.
// We need to use one where source is embedded, due to webviews (they restrict resources to specific schemes,
// this seems to prevent chrome from downloading the source maps)
devtool: 'eval-source-map',
optimization: {
minimizer: [new TerserPlugin()]
},
node: {
fs: 'empty'
},
plugins: [
new HtmlWebpackPlugin({ template: 'src/datascience-ui/history-react/index.html', imageBaseUrl: `${__dirname.replace(/\\/g, '/')}/out/datascience-ui/history-react`, indexUrl: `${__dirname}/out/1`, filename: './datascience-ui/history-react/index.html' }),
new FixDefaultImportPlugin(),
new CopyWebpackPlugin([
{ from: './**/*.png', to: '.' },
{ from: './**/*.svg', to: '.' },
{ from: './**/*.css', to: '.' },
{ from: './**/*theme*.json', to: '.' }
], { context: 'src' }),
new MonacoWebpackPlugin({
languages: [] // force to empty so onigasm will be used
})
],
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: [".ts", ".tsx", ".js", ".json", ".svg"]
},
module: {
rules: [
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
{
test: /\.tsx?$/,
use: {
loader: "awesome-typescript-loader",
options: {
configFileName,
reportFiles: [
'src/datascience-ui/**/*.{ts,tsx}'
]
},
}
},
{
test: /\.svg$/,
use: [
'svg-inline-loader'
]
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
],
},
{
test: /\.js$/,
include: /node_modules.*remark.*default.*js/,
use: [
{
loader: path.resolve('./build/webpack/loaders/remarkLoader.js'),
options: {}
}
]
},
{
test: /\.json$/,
type: 'javascript/auto',
include: /node_modules.*remark.*/,
use: [
{
loader: path.resolve('./build/webpack/loaders/jsonloader.js'),
options: {}
}
]
},
{ test: /\.(png|woff|woff2|eot|ttf)$/, loader: 'url-loader?limit=100000' },
{
test: /\.less$/,
use: [
'style-loader',
'css-loader',
'less-loader'
]
}
]
}
},
{
entry: ['babel-polyfill', './src/datascience-ui/native-editor/index.tsx'],
output: {
path: path.join(__dirname, 'out'),
filename: 'datascience-ui/native-editor/index_bundle.js',
publicPath: './'
},
mode: 'development', // Leave as is, we'll need to see stack traces when there are errors.
// Use 'eval' for release and `eval-source-map` for development.
// We need to use one where source is embedded, due to webviews (they restrict resources to specific schemes,
// this seems to prevent chrome from downloading the source maps)
devtool: 'eval-source-map',
optimization: {
minimizer: [new TerserPlugin()]
},
node: {
fs: 'empty'
},
plugins: [
new HtmlWebpackPlugin({ template: 'src/datascience-ui/native-editor/index.html', imageBaseUrl: `${__dirname.replace(/\\/g, '/')}/out/datascience-ui/native-editor`, indexUrl: `${__dirname}/out/1`, filename: './datascience-ui/native-editor/index.html' }),
new FixDefaultImportPlugin(),
new CopyWebpackPlugin([
{ from: './**/*.png', to: '.' },
{ from: './**/*.svg', to: '.' },
{ from: './**/*.css', to: '.' },
{ from: './**/*theme*.json', to: '.' }
], { context: 'src' }),
new MonacoWebpackPlugin({
languages: [] // force to empty so onigasm will be used
})
],
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: [".ts", ".tsx", ".js", ".json", ".svg"]
},
module: {
rules: [
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
{
test: /\.tsx?$/,
use: {
loader: "awesome-typescript-loader",
options: {
configFileName,
reportFiles: [
'src/datascience-ui/**/*.{ts,tsx}'
]
},
}
},
{
test: /\.svg$/,
use: [
'svg-inline-loader'
]
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
],
},
{
test: /\.js$/,
include: /node_modules.*remark.*default.*js/,
use: [
{
loader: path.resolve('./build/webpack/loaders/remarkLoader.js'),
options: {}
}
]
},
{
test: /\.json$/,
type: 'javascript/auto',
include: /node_modules.*remark.*/,
use: [
{
loader: path.resolve('./build/webpack/loaders/jsonloader.js'),
options: {}
}
]
},
{ test: /\.(png|woff|woff2|eot|ttf)$/, loader: 'url-loader?limit=100000' },
{
test: /\.less$/,
use: [
'style-loader',
'css-loader',
'less-loader'
]
}
]
}
},
{
entry: ['babel-polyfill', './src/datascience-ui/data-explorer/index.tsx'],
output: {
path: path.join(__dirname, 'out'),
filename: 'datascience-ui/data-explorer/index_bundle.js',
publicPath: './'
},
mode: 'development', // Leave as is, we'll need to see stack traces when there are errors.
// Use 'eval' for release and `eval-source-map` for development.
// We need to use one where source is embedded, due to webviews (they restrict resources to specific schemes,
// this seems to prevent chrome from downloading the source maps)
devtool: 'eval-source-map',
optimization: {
minimizer: [new TerserPlugin()]
},
node: {
fs: 'empty'
},
plugins: [
new HtmlWebpackPlugin({ template: 'src/datascience-ui/data-explorer/index.html', imageBaseUrl: `${__dirname.replace(/\\/g, '/')}/out/datascience-ui/data-explorer`, indexUrl: `${__dirname}/out/1`, filename: './datascience-ui/data-explorer/index.html' }),
new FixDefaultImportPlugin(),
new CopyWebpackPlugin([
{ from: './**/*.png', to: '.' },
{ from: './**/*.svg', to: '.' },
{ from: './**/*.css', to: '.' },
{ from: './**/*theme*.json', to: '.' }
], { context: 'src' }),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
}
})
],
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: [".ts", ".tsx", ".js", ".json", ".svg"]
},
module: {
rules: [
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
{
test: /\.tsx?$/,
use: {
loader: "awesome-typescript-loader",
options: {
configFileName,
reportFiles: [
'src/datascience-ui/**/*.{ts,tsx}'
]
},
}
},
{
test: /\.svg$/,
use: [
'svg-inline-loader'
]
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
],
},
{
test: /\.js$/,
include: /node_modules.*remark.*default.*js/,
use: [
{
loader: path.resolve('./build/webpack/loaders/remarkLoader.js'),
options: {}
}
]
},
{ test: /\.(png|woff|woff2|eot|gif|ttf)$/, loader: 'url-loader?limit=100000' },
{
test: /\.json$/,
type: 'javascript/auto',
include: /node_modules.*remark.*/,
use: [
{
loader: path.resolve('./build/webpack/loaders/jsonloader.js'),
options: {}
}
]
}
]
}
},
{
entry: ['babel-polyfill', './src/datascience-ui/plot/index.tsx'],
output: {
path: path.join(__dirname, 'out'),
filename: 'datascience-ui/plot/index_bundle.js',
publicPath: './'
},
mode: 'development', // Leave as is, we'll need to see stack traces when there are errors.
// Use 'eval' for release and `eval-source-map` for development.
// We need to use one where source is embedded, due to webviews (they restrict resources to specific schemes,
// this seems to prevent chrome from downloading the source maps)
devtool: 'eval-source-map',
optimization: {
minimizer: [new TerserPlugin()]
},
node: {
fs: 'empty'
},
plugins: [
new HtmlWebpackPlugin({ template: 'src/datascience-ui/plot/index.html', imageBaseUrl: `${__dirname.replace(/\\/g, '/')}/out/datascience-ui/plot`, indexUrl: `${__dirname}/out/1`, filename: './datascience-ui/plot/index.html' }),
new FixDefaultImportPlugin(),
new CopyWebpackPlugin([
{ from: './**/*.png', to: '.' },
{ from: './**/*.svg', to: '.' },
{ from: './**/*.css', to: '.' },
{ from: './**/*theme*.json', to: '.' }
], { context: 'src' }),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
}
})
],
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: [".ts", ".tsx", ".js", ".json", ".svg"]
},
module: {
rules: [
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
{
test: /\.tsx?$/,
use: {
loader: "awesome-typescript-loader",
options: {
configFileName,
reportFiles: [
'src/datascience-ui/**/*.{ts,tsx}'
]
},
}
},
{
test: /\.svg$/,
use: [
'svg-inline-loader'
]
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
],
},
{
test: /\.js$/,
include: /node_modules.*remark.*default.*js/,
use: [
{
loader: path.resolve('./build/webpack/loaders/remarkLoader.js'),
options: {}
}
]
},
{ test: /\.(png|woff|woff2|eot|gif|ttf)$/, loader: 'url-loader?limit=100000' },
{
test: /\.json$/,
type: 'javascript/auto',
include: /node_modules.*remark.*/,
use: [
{
loader: path.resolve('./build/webpack/loaders/jsonloader.js'),
options: {}
}
]
}
]
}
}
];
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。